diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-04-03 14:15:00 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-04-03 14:15:00 +0000 |
commit | 2874c81cc80b7f1005073748e8f1877055bf97a7 (patch) | |
tree | 4b7f74a856abd49bb61e10caab57c0ffc46667a9 /libavformat | |
parent | 0e642188896c564869bd6446a70e6969b229947d (diff) | |
download | ffmpeg-2874c81cc80b7f1005073748e8f1877055bf97a7.tar.gz |
Replace all remaining occurrences of AVERROR_NOMEM with
AVERROR(ENOMEM).
AVERROR_NOMEM is deprecated and will be dropped at the next libavutil
major bump.
Originally committed as revision 22791 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/ape.c | 4 | ||||
-rw-r--r-- | libavformat/apetag.c | 2 | ||||
-rw-r--r-- | libavformat/cafdec.c | 2 | ||||
-rw-r--r-- | libavformat/flacdec.c | 2 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 4 | ||||
-rw-r--r-- | libavformat/msnwc_tcp.c | 2 | ||||
-rw-r--r-- | libavformat/oggenc.c | 8 | ||||
-rw-r--r-- | libavformat/rmdec.c | 2 | ||||
-rw-r--r-- | libavformat/rtpdec_amr.c | 2 | ||||
-rw-r--r-- | libavformat/rtpdec_h263.c | 2 | ||||
-rw-r--r-- | libavformat/rtpdec_xiph.c | 10 | ||||
-rw-r--r-- | libavformat/wc3movie.c | 2 |
12 files changed, 21 insertions, 21 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c index 102e191a3f..91acf7240d 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -248,7 +248,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) } 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(AVFormatContext * s, AVPacket * pkt) 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); diff --git a/libavformat/apetag.c b/libavformat/apetag.c index d8cad855bc..d30c13222a 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -56,7 +56,7 @@ static int ape_tag_read_field(AVFormatContext *s) 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); diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 720a49a899..3fe4eab5c7 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -61,7 +61,7 @@ static int read_desc_chunk(AVFormatContext *s) /* 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; diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 02ae8ae628..2ceef964e8 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -67,7 +67,7 @@ static int flac_read_header(AVFormatContext *s, 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); diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index adb94af956..f05e3314ee 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -433,7 +433,7 @@ static int mpegts_write_header(AVFormatContext *s) 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(AVFormatContext *s, AVPacket *pkt) 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); diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c index 5b498e925e..e5488718bc 100644 --- a/libavformat/msnwc_tcp.c +++ b/libavformat/msnwc_tcp.c @@ -77,7 +77,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap) st = av_new_stream(ctx, 0); if(!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); codec = st->codec; codec->codec_type = AVMEDIA_TYPE_VIDEO; diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 10fe20d04c..36ea21cd41 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -121,7 +121,7 @@ static int ogg_build_flac_headers(AVCodecContext *avctx, 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(AVCodecContext *avctx, // 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(AVCodecContext *avctx, // 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(AVCodecContext *avctx, // 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; diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index b8abcfc0b1..8fc0d96df1 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -106,7 +106,7 @@ static int rm_read_extradata(ByteIOContext *pb, AVCodecContext *avctx, unsigned 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) diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c index 38399c6660..a7b36c7ab7 100644 --- a/libavformat/rtpdec_amr.c +++ b/libavformat/rtpdec_amr.c @@ -83,7 +83,7 @@ static int amr_handle_packet(AVFormatContext *ctx, /* 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; diff --git a/libavformat/rtpdec_h263.c b/libavformat/rtpdec_h263.c index 3d5925e9a4..19de6eca26 100644 --- a/libavformat/rtpdec_h263.c +++ b/libavformat/rtpdec_h263.c @@ -78,7 +78,7 @@ static int h263_handle_packet(AVFormatContext *ctx, 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; diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c index 302f9858d3..1c6eef7d9e 100644 --- a/libavformat/rtpdec_xiph.c +++ b/libavformat/rtpdec_xiph.c @@ -134,7 +134,7 @@ static int xiph_handle_packet(AVFormatContext * ctx, 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(AVFormatContext * ctx, 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 * packed_headers, 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(AVCodecContext * codec, } 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(AVFormatContext *s, int st_index, 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)) { diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index 4138873573..a91df1b036 100644 --- a/libavformat/wc3movie.c +++ b/libavformat/wc3movie.c @@ -186,7 +186,7 @@ static int wc3_read_header(AVFormatContext *s, /* 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; |