changeset 5930:08cd1179a20d libavformat

Replace all remaining occurrences of AVERROR_NOMEM with AVERROR(ENOMEM). AVERROR_NOMEM is deprecated and will be dropped at the next libavutil major bump.
author stefano
date Sat, 03 Apr 2010 14:15:00 +0000
parents 903f1b00cbc6
children 742d48f7f5fb
files ape.c apetag.c cafdec.c flacdec.c mpegtsenc.c msnwc_tcp.c oggenc.c rmdec.c rtpdec_amr.c rtpdec_h263.c rtpdec_xiph.c wc3movie.c
diffstat 12 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ape.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/ape.c	Sat Apr 03 14:15:00 2010 +0000
@@ -248,7 +248,7 @@
     }
     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 @@
         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);
--- a/apetag.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/apetag.c	Sat Apr 03 14:15:00 2010 +0000
@@ -56,7 +56,7 @@
         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);
--- a/cafdec.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/cafdec.c	Sat Apr 03 14:15:00 2010 +0000
@@ -61,7 +61,7 @@
     /* 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;
--- a/flacdec.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/flacdec.c	Sat Apr 03 14:15:00 2010 +0000
@@ -67,7 +67,7 @@
         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);
--- a/mpegtsenc.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/mpegtsenc.c	Sat Apr 03 14:15:00 2010 +0000
@@ -433,7 +433,7 @@
             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 @@
                 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);
--- a/msnwc_tcp.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/msnwc_tcp.c	Sat Apr 03 14:15:00 2010 +0000
@@ -77,7 +77,7 @@
 
     st = av_new_stream(ctx, 0);
     if(!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
 
     codec = st->codec;
     codec->codec_type = AVMEDIA_TYPE_VIDEO;
--- a/oggenc.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/oggenc.c	Sat Apr 03 14:15:00 2010 +0000
@@ -121,7 +121,7 @@
     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 @@
     // 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 @@
     // 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 @@
     // 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;
--- a/rmdec.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/rmdec.c	Sat Apr 03 14:15:00 2010 +0000
@@ -106,7 +106,7 @@
         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)
--- a/rtpdec_amr.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/rtpdec_amr.c	Sat Apr 03 14:15:00 2010 +0000
@@ -83,7 +83,7 @@
     /* 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;
--- a/rtpdec_h263.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/rtpdec_h263.c	Sat Apr 03 14:15:00 2010 +0000
@@ -78,7 +78,7 @@
 
     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;
--- a/rtpdec_xiph.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/rtpdec_xiph.c	Sat Apr 03 14:15:00 2010 +0000
@@ -134,7 +134,7 @@
 
         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 @@
 
             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 @@
     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 @@
             } 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 @@
 
     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)) {
--- a/wc3movie.c	Sat Apr 03 12:16:33 2010 +0000
+++ b/wc3movie.c	Sat Apr 03 14:15:00 2010 +0000
@@ -186,7 +186,7 @@
             /* 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;