[FFmpeg-cvslog] r22791 - in trunk: libavcodec/ac3dec.c libavcodec/eatgv.c libavcodec/flacenc.c libavcodec/gif.c libavdevice/vfwcap.c libavformat/ape.c libavformat/apetag.c libavformat/cafdec.c libavformat/flacdec....

stefano subversion
Sat Apr 3 16:15:01 CEST 2010


Author: stefano
Date: Sat Apr  3 16:15:00 2010
New Revision: 22791

Log:
Replace all remaining occurrences of AVERROR_NOMEM with
AVERROR(ENOMEM).

AVERROR_NOMEM is deprecated and will be dropped at the next libavutil
major bump.

Modified:
   trunk/libavcodec/ac3dec.c
   trunk/libavcodec/eatgv.c
   trunk/libavcodec/flacenc.c
   trunk/libavcodec/gif.c
   trunk/libavdevice/vfwcap.c
   trunk/libavformat/ape.c
   trunk/libavformat/apetag.c
   trunk/libavformat/cafdec.c
   trunk/libavformat/flacdec.c
   trunk/libavformat/mpegtsenc.c
   trunk/libavformat/msnwc_tcp.c
   trunk/libavformat/oggenc.c
   trunk/libavformat/rmdec.c
   trunk/libavformat/rtpdec_amr.c
   trunk/libavformat/rtpdec_h263.c
   trunk/libavformat/rtpdec_xiph.c
   trunk/libavformat/wc3movie.c

Modified: trunk/libavcodec/ac3dec.c
==============================================================================
--- trunk/libavcodec/ac3dec.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavcodec/ac3dec.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -216,7 +216,7 @@ static av_cold int ac3_decode_init(AVCod
     if (avctx->error_recognition >= FF_ER_CAREFUL) {
         s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
         if (!s->input_buffer)
-            return AVERROR_NOMEM;
+            return AVERROR(ENOMEM);
     }
 
     avctx->sample_fmt = SAMPLE_FMT_S16;

Modified: trunk/libavcodec/eatgv.c
==============================================================================
--- trunk/libavcodec/eatgv.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavcodec/eatgv.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -288,11 +288,11 @@ static int tgv_decode_frame(AVCodecConte
         /* allocate additional 12 bytes to accomodate av_memcpy_backptr() OUTBUF_PADDED optimisation */
         s->frame.data[0] = av_malloc(s->width*s->height + 12);
         if (!s->frame.data[0])
-            return AVERROR_NOMEM;
+            return AVERROR(ENOMEM);
         s->frame.data[1] = av_malloc(AVPALETTE_SIZE);
         if (!s->frame.data[1]) {
             av_freep(&s->frame.data[0]);
-            return AVERROR_NOMEM;
+            return AVERROR(ENOMEM);
         }
     }
     memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE);

Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavcodec/flacenc.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -352,7 +352,7 @@ static av_cold int flac_encode_init(AVCo
     /* initialize MD5 context */
     s->md5ctx = av_malloc(av_md5_size);
     if(!s->md5ctx)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     av_md5_init(s->md5ctx);
 
     streaminfo = av_malloc(FLAC_STREAMINFO_SIZE);

Modified: trunk/libavcodec/gif.c
==============================================================================
--- trunk/libavcodec/gif.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavcodec/gif.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -133,10 +133,10 @@ static av_cold int gif_encode_init(AVCod
     avctx->coded_frame = &s->picture;
     s->lzw = av_mallocz(ff_lzw_encode_state_size);
     if (!s->lzw)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     s->buf = av_malloc(avctx->width*avctx->height*2);
     if (!s->buf)
-         return AVERROR_NOMEM;
+         return AVERROR(ENOMEM);
     return 0;
 }
 

Modified: trunk/libavdevice/vfwcap.c
==============================================================================
--- trunk/libavdevice/vfwcap.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavdevice/vfwcap.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -284,7 +284,7 @@ static int vfw_read_header(AVFormatConte
     st = av_new_stream(s, 0);
     if(!st) {
         vfw_read_close(s);
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
 
     /* Set video format */
@@ -294,7 +294,7 @@ static int vfw_read_header(AVFormatConte
     bi = av_malloc(bisize);
     if(!bi) {
         vfw_read_close(s);
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
     ret = SendMessage(ctx->hwnd, WM_CAP_GET_VIDEOFORMAT, bisize, (LPARAM) bi);
     if(!ret)

Modified: trunk/libavformat/ape.c
==============================================================================
--- trunk/libavformat/ape.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/ape.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -248,7 +248,7 @@ static int ape_read_header(AVFormatConte
     }
     ape->frames       = av_malloc(ape->totalframes * sizeof(APEFrame));
     if(!ape->frames)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     ape->firstframe   = ape->junklength + ape->descriptorlength + ape->headerlength + ape->seektablelength + ape->wavheaderlength;
     ape->currentframe = 0;
 
@@ -351,7 +351,7 @@ static int ape_read_packet(AVFormatConte
         nblocks = ape->blocksperframe;
 
     if (av_new_packet(pkt,  ape->frames[ape->currentframe].size + extra_size) < 0)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
 
     AV_WL32(pkt->data    , nblocks);
     AV_WL32(pkt->data + 4, ape->frames[ape->currentframe].skip);

Modified: trunk/libavformat/apetag.c
==============================================================================
--- trunk/libavformat/apetag.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/apetag.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -56,7 +56,7 @@ static int ape_tag_read_field(AVFormatCo
         return -1;
     value = av_malloc(size+1);
     if (!value)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     get_buffer(pb, value, size);
     value[size] = 0;
     av_metadata_set2(&s->metadata, key, value, AV_METADATA_DONT_STRDUP_VAL);

Modified: trunk/libavformat/cafdec.c
==============================================================================
--- trunk/libavformat/cafdec.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/cafdec.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -61,7 +61,7 @@ static int read_desc_chunk(AVFormatConte
     /* new audio stream */
     st = av_new_stream(s, 0);
     if (!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
 
     /* parse format description */
     st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;

Modified: trunk/libavformat/flacdec.c
==============================================================================
--- trunk/libavformat/flacdec.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/flacdec.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -67,7 +67,7 @@ static int flac_read_header(AVFormatCont
         case FLAC_METADATA_TYPE_VORBIS_COMMENT:
             buffer = av_mallocz(metadata_size + FF_INPUT_BUFFER_PADDING_SIZE);
             if (!buffer) {
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
             }
             if (get_buffer(s->pb, buffer, metadata_size) != metadata_size) {
                 av_freep(&buffer);

Modified: trunk/libavformat/mpegtsenc.c
==============================================================================
--- trunk/libavformat/mpegtsenc.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/mpegtsenc.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -433,7 +433,7 @@ static int mpegts_write_header(AVFormatC
             st->codec->extradata_size > 0) {
             ts_st->adts = av_mallocz(sizeof(*ts_st->adts));
             if (!ts_st->adts)
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
             if (ff_adts_decode_extradata(s, ts_st->adts, st->codec->extradata,
                                          st->codec->extradata_size) < 0)
                 return -1;
@@ -836,7 +836,7 @@ static int mpegts_write_packet(AVFormatC
                 return -1;
             data = av_malloc(new_size);
             if (!data)
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
             ff_adts_write_frame_header(adts, data, pkt->size, adts->pce_size);
             if (adts->pce_size) {
                 memcpy(data+ADTS_HEADER_SIZE, adts->pce_data, adts->pce_size);

Modified: trunk/libavformat/msnwc_tcp.c
==============================================================================
--- trunk/libavformat/msnwc_tcp.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/msnwc_tcp.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -77,7 +77,7 @@ static int msnwc_tcp_read_header(AVForma
 
     st = av_new_stream(ctx, 0);
     if(!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
 
     codec = st->codec;
     codec->codec_type = AVMEDIA_TYPE_VIDEO;

Modified: trunk/libavformat/oggenc.c
==============================================================================
--- trunk/libavformat/oggenc.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/oggenc.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -121,7 +121,7 @@ static int ogg_build_flac_headers(AVCode
     oggstream->header[0] = av_mallocz(51); // per ogg flac specs
     p = oggstream->header[0];
     if (!p)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     bytestream_put_byte(&p, 0x7F);
     bytestream_put_buffer(&p, "FLAC", 4);
     bytestream_put_byte(&p, 1); // major version
@@ -135,7 +135,7 @@ static int ogg_build_flac_headers(AVCode
     // second packet: VorbisComment
     p = ogg_write_vorbiscomment(4, bitexact, &oggstream->header_len[1], m);
     if (!p)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     oggstream->header[1] = p;
     bytestream_put_byte(&p, 0x84); // last metadata block and vorbis comment
     bytestream_put_be24(&p, oggstream->header_len[1] - 4);
@@ -157,7 +157,7 @@ static int ogg_build_speex_headers(AVCod
     // first packet: Speex header
     p = av_mallocz(SPEEX_HEADER_SIZE);
     if (!p)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     oggstream->header[0] = p;
     oggstream->header_len[0] = SPEEX_HEADER_SIZE;
     bytestream_put_buffer(&p, avctx->extradata, SPEEX_HEADER_SIZE);
@@ -166,7 +166,7 @@ static int ogg_build_speex_headers(AVCod
     // second packet: VorbisComment
     p = ogg_write_vorbiscomment(0, bitexact, &oggstream->header_len[1], m);
     if (!p)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     oggstream->header[1] = p;
 
     return 0;

Modified: trunk/libavformat/rmdec.c
==============================================================================
--- trunk/libavformat/rmdec.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/rmdec.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -106,7 +106,7 @@ static int rm_read_extradata(ByteIOConte
         return -1;
     avctx->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!avctx->extradata)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     avctx->extradata_size = get_buffer(pb, avctx->extradata, size);
     memset(avctx->extradata + avctx->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
     if (avctx->extradata_size != size)

Modified: trunk/libavformat/rtpdec_amr.c
==============================================================================
--- trunk/libavformat/rtpdec_amr.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/rtpdec_amr.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -83,7 +83,7 @@ static int amr_handle_packet(AVFormatCon
     /* Everything except the codec mode request byte should be output. */
     if (av_new_packet(pkt, len - 1)) {
         av_log(ctx, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
     pkt->stream_index = st->index;
     ptr = pkt->data;

Modified: trunk/libavformat/rtpdec_h263.c
==============================================================================
--- trunk/libavformat/rtpdec_h263.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/rtpdec_h263.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -78,7 +78,7 @@ static int h263_handle_packet(AVFormatCo
 
     if (av_new_packet(pkt, len + startcode)) {
         av_log(ctx, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
     pkt->stream_index = st->index;
     ptr = pkt->data;

Modified: trunk/libavformat/rtpdec_xiph.c
==============================================================================
--- trunk/libavformat/rtpdec_xiph.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/rtpdec_xiph.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -134,7 +134,7 @@ static int xiph_handle_packet(AVFormatCo
 
         if (av_new_packet(pkt, data_len)) {
             av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-            return AVERROR_NOMEM;
+            return AVERROR(ENOMEM);
         }
         pkt->stream_index = st->index;
 
@@ -189,7 +189,7 @@ static int xiph_handle_packet(AVFormatCo
 
             if (av_new_packet(pkt, frame_size)) {
                 av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
             }
 
             memcpy(pkt->data, xiph_data, frame_size);
@@ -272,7 +272,7 @@ parse_packed_headers(const uint8_t * pac
     ptr = codec->extradata = av_malloc(extradata_alloc);
     if (!ptr) {
         av_log(codec, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
     *ptr++ = 2;
     ptr += av_xiphlacing(ptr, length1);
@@ -331,7 +331,7 @@ static int xiph_parse_fmtp_pair(AVCodecC
             } else {
                 av_log(codec, AV_LOG_ERROR,
                        "Out of memory while decoding SDP configuration.\n");
-                result = AVERROR_NOMEM;
+                result = AVERROR(ENOMEM);
             }
         } else {
             av_log(codec, AV_LOG_ERROR, "Packet too large\n");
@@ -356,7 +356,7 @@ static int xiph_parse_sdp_line(AVFormatC
 
     if (!(value = av_malloc(value_size))) {
         av_log(codec, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
 
     if (av_strstart(line, "fmtp:", &p)) {

Modified: trunk/libavformat/wc3movie.c
==============================================================================
--- trunk/libavformat/wc3movie.c	Sat Apr  3 14:16:33 2010	(r22790)
+++ trunk/libavformat/wc3movie.c	Sat Apr  3 16:15:00 2010	(r22791)
@@ -186,7 +186,7 @@ static int wc3_read_header(AVFormatConte
             /* load up the name */
             buffer = av_malloc(size+1);
             if (!buffer)
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
             if ((ret = get_buffer(pb, buffer, size)) != size)
                 return AVERROR(EIO);
             buffer[size] = 0;



More information about the ffmpeg-cvslog mailing list