Mercurial > libavformat.hg
changeset 2273:7eb456c4ed8a libavformat
Replace all occurrences of AVERROR_NOMEM with AVERROR(ENOMEM).
author | takis |
---|---|
date | Thu, 19 Jul 2007 15:21:30 +0000 |
parents | 8963d9ed1859 |
children | b21c2af60bc9 |
files | 4xm.c aiff.c amr.c apc.c avs.c bethsoftvid.c c93.c dsicin.c dxa.c electronicarts.c flic.c flvdec.c idcin.c idroq.c ipmovie.c matroskadec.c mm.c mmf.c mp3.c mpc.c mtv.c nut.c nutdec.c ogg.c ogg2.c psxstr.c raw.c rtsp.c segafilm.c sierravmd.c smacker.c thp.c tiertexseq.c tta.c txd.c utils.c vocdec.c wav.c wc3movie.c westwood.c wv.c |
diffstat | 41 files changed, 104 insertions(+), 104 deletions(-) [+] |
line wrap: on
line diff
--- a/4xm.c Thu Jul 19 14:48:13 2007 +0000 +++ b/4xm.c Thu Jul 19 15:21:30 2007 +0000 @@ -116,7 +116,7 @@ /* allocate space for the header and load the whole thing */ header = av_malloc(header_size); if (!header) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); if (get_buffer(pb, header, header_size) != header_size) return AVERROR_IO; @@ -140,7 +140,7 @@ /* allocate a new AVStream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 60, 1, fourxm->fps); fourxm->video_stream_index = st->index; @@ -166,7 +166,7 @@ fourxm->track_count * sizeof(AudioTrack)); if (!fourxm->tracks) { av_free(header); - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } } fourxm->tracks[current_track].adpcm = AV_RL32(&header[i + 12]); @@ -178,7 +178,7 @@ /* allocate a new AVStream */ st = av_new_stream(s, current_track); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 60, 1, fourxm->tracks[current_track].sample_rate);
--- a/aiff.c Thu Jul 19 14:48:13 2007 +0000 +++ b/aiff.c Thu Jul 19 15:21:30 2007 +0000 @@ -312,7 +312,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); while (filesize > 0) { /* parse different chunks */
--- a/amr.c Thu Jul 19 14:48:13 2007 +0000 +++ b/amr.c Thu Jul 19 15:21:30 2007 +0000 @@ -87,7 +87,7 @@ st = av_new_stream(s, 0); if (!st) { - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if(memcmp(header,AMR_header,6)!=0) {
--- a/apc.c Thu Jul 19 14:48:13 2007 +0000 +++ b/apc.c Thu Jul 19 15:21:30 2007 +0000 @@ -41,7 +41,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS; @@ -53,7 +53,7 @@ st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); /* initial predictor values for adpcm decoder */ get_buffer(pb, st->codec->extradata, 2 * 4);
--- a/avs.c Thu Jul 19 14:48:13 2007 +0000 +++ b/avs.c Thu Jul 19 15:21:30 2007 +0000 @@ -176,7 +176,7 @@ if (!avs->st_video) { avs->st_video = av_new_stream(s, AVS_VIDEO); if (avs->st_video == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); avs->st_video->codec->codec_type = CODEC_TYPE_VIDEO; avs->st_video->codec->codec_id = CODEC_ID_AVS; avs->st_video->codec->width = avs->width; @@ -193,7 +193,7 @@ if (!avs->st_audio) { avs->st_audio = av_new_stream(s, AVS_AUDIO); if (avs->st_audio == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); avs->st_audio->codec->codec_type = CODEC_TYPE_AUDIO; } avs->remaining_audio_size = size - 4;
--- a/bethsoftvid.c Thu Jul 19 14:48:13 2007 +0000 +++ b/bethsoftvid.c Thu Jul 19 15:21:30 2007 +0000 @@ -71,7 +71,7 @@ stream = av_new_stream(s, 0); if (!stream) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps stream->codec->codec_type = CODEC_TYPE_VIDEO; stream->codec->codec_id = CODEC_ID_BETHSOFTVID; @@ -84,7 +84,7 @@ // done with video codec, set up audio codec stream = av_new_stream(s, 0); if (!stream) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); stream->codec->codec_type = CODEC_TYPE_AUDIO; stream->codec->codec_id = CODEC_ID_PCM_U8; stream->codec->channels = 1; @@ -108,7 +108,7 @@ vidbuf_start = av_malloc(vidbuf_capacity = BUFFER_PADDING_SIZE); if(!vidbuf_start) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); // save the file position for the packet, include block type position = url_ftell(pb) - 1; @@ -128,7 +128,7 @@ do{ vidbuf_start = av_fast_realloc(vidbuf_start, &vidbuf_capacity, vidbuf_nbytes + BUFFER_PADDING_SIZE); if(!vidbuf_start) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); code = get_byte(pb); vidbuf_start[vidbuf_nbytes++] = code;
--- a/c93.c Thu Jul 19 14:48:13 2007 +0000 +++ b/c93.c Thu Jul 19 15:21:30 2007 +0000 @@ -77,7 +77,7 @@ video = av_new_stream(s, 0); if (!video) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); video->codec->codec_type = CODEC_TYPE_VIDEO; video->codec->codec_id = CODEC_ID_C93; @@ -115,7 +115,7 @@ if (!c93->audio) { c93->audio = av_new_stream(s, 1); if (!c93->audio) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); c93->audio->codec->codec_type = CODEC_TYPE_AUDIO; } url_fskip(pb, 26); /* VOC header */
--- a/dsicin.c Thu Jul 19 14:48:13 2007 +0000 +++ b/dsicin.c Thu Jul 19 15:21:30 2007 +0000 @@ -108,7 +108,7 @@ /* initialize the video decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 32, 1, 12); cin->video_stream_index = st->index; @@ -121,7 +121,7 @@ /* initialize the audio decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 32, 1, 22050); cin->audio_stream_index = st->index; @@ -178,7 +178,7 @@ pkt_size = (palette_type + 3) * hdr->pal_colors_count + hdr->video_frame_size; if (av_new_packet(pkt, 4 + pkt_size)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); pkt->stream_index = cin->video_stream_index; pkt->pts = cin->video_stream_pts++; @@ -198,7 +198,7 @@ /* audio packet */ if (av_new_packet(pkt, cin->audio_buffer_size)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); pkt->stream_index = cin->audio_stream_index; pkt->pts = cin->audio_stream_pts;
--- a/dxa.c Thu Jul 19 14:48:13 2007 +0000 +++ b/dxa.c Thu Jul 19 15:21:30 2007 +0000 @@ -160,7 +160,7 @@ switch(AV_RL32(buf)){ case MKTAG('N', 'U', 'L', 'L'): if(av_new_packet(pkt, 4 + pal_size) < 0) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); pkt->stream_index = 0; if(pal_size) memcpy(pkt->data, pal, pal_size); memcpy(pkt->data + pal_size, buf, 4); @@ -181,7 +181,7 @@ return -1; } if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); memcpy(pkt->data + pal_size, buf, DXA_EXTRA_SIZE); ret = get_buffer(&s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size); if(ret != size){
--- a/electronicarts.c Thu Jul 19 14:48:13 2007 +0000 +++ b/electronicarts.c Thu Jul 19 15:21:30 2007 +0000 @@ -184,7 +184,7 @@ /* initialize the video decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); ea->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; @@ -195,7 +195,7 @@ /* initialize the audio decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, EA_SAMPLE_RATE); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_EA;
--- a/flic.c Thu Jul 19 14:48:13 2007 +0000 +++ b/flic.c Thu Jul 19 15:21:30 2007 +0000 @@ -86,7 +86,7 @@ /* initialize the decoder streams */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); flic->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_FLIC;
--- a/flvdec.c Thu Jul 19 14:48:13 2007 +0000 +++ b/flvdec.c Thu Jul 19 15:21:30 2007 +0000 @@ -237,14 +237,14 @@ if(flags & FLV_HEADER_FLAG_HASVIDEO){ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_VIDEO; av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */ } if(flags & FLV_HEADER_FLAG_HASAUDIO){ st = av_new_stream(s, 1); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */ }
--- a/idcin.c Thu Jul 19 14:48:13 2007 +0000 +++ b/idcin.c Thu Jul 19 15:21:30 2007 +0000 @@ -151,7 +151,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); idcin->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; @@ -174,7 +174,7 @@ idcin->audio_present = 1; st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); idcin->audio_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_AUDIO;
--- a/idroq.c Thu Jul 19 14:48:13 2007 +0000 +++ b/idroq.c Thu Jul 19 15:21:30 2007 +0000 @@ -140,7 +140,7 @@ /* initialize the decoders */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); /* set the pts reference (1 pts = 1/90000) */ av_set_pts_info(st, 33, 1, 90000); roq->video_stream_index = st->index; @@ -153,7 +153,7 @@ if (roq->audio_channels) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); roq->audio_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_AUDIO;
--- a/ipmovie.c Thu Jul 19 14:48:13 2007 +0000 +++ b/ipmovie.c Thu Jul 19 15:21:30 2007 +0000 @@ -551,7 +551,7 @@ /* initialize the stream decoders */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); ipmovie->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; @@ -566,7 +566,7 @@ if (ipmovie->audio_type) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); ipmovie->audio_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_AUDIO; @@ -598,7 +598,7 @@ else if (ret == CHUNK_EOF) ret = AVERROR_IO; else if (ret == CHUNK_NOMEM) - ret = AVERROR_NOMEM; + ret = AVERROR(ENOMEM); else if (ret == CHUNK_VIDEO) ret = 0; else
--- a/matroskadec.c Thu Jul 19 14:48:13 2007 +0000 +++ b/matroskadec.c Thu Jul 19 15:21:30 2007 +0000 @@ -485,7 +485,7 @@ * byte more, read the string and NULL-terminate it ourselves. */ if (size < 0 || !(*str = av_malloc(size + 1))) { av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation failed\n"); - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if (get_buffer(pb, (uint8_t *) *str, size) != size) { offset_t pos = url_ftell(pb); @@ -581,7 +581,7 @@ if (!(*binary = av_malloc(*size))) { av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation error\n"); - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if (get_buffer(pb, *binary, *size) != *size) { @@ -2074,7 +2074,7 @@ int sri = matroska_aac_sri(audiotrack->internal_samplerate); extradata = av_malloc(5); if (extradata == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); extradata[0] = (profile << 3) | ((sri&0x0E) >> 1); extradata[1] = ((sri&0x01) << 7) | (audiotrack->channels<<3); if (strstr(track->codec_id, "SBR")) { @@ -2095,7 +2095,7 @@ extradata_size = 30; extradata = av_mallocz(extradata_size); if (extradata == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); init_put_byte(&b, extradata, extradata_size, 1, NULL, NULL, NULL, NULL); put_buffer(&b, (uint8_t *) "TTA1", 4); @@ -2164,7 +2164,7 @@ matroska->num_streams++; st = av_new_stream(s, track->stream_index); if (st == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, matroska->time_scale, 1000*1000*1000); /* 64 bit pts in ns */ st->codec->codec_id = codec_id; @@ -2182,7 +2182,7 @@ } else if(track->codec_priv && track->codec_priv_size > 0){ st->codec->extradata = av_malloc(track->codec_priv_size); if(st->codec->extradata == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->extradata_size = track->codec_priv_size; memcpy(st->codec->extradata,track->codec_priv+extradata_offset, track->codec_priv_size); @@ -2451,7 +2451,7 @@ pkt = av_mallocz(sizeof(AVPacket)); /* XXX: prevent data copy... */ if (av_new_packet(pkt, slice_size-offset) < 0) { - res = AVERROR_NOMEM; + res = AVERROR(ENOMEM); n = laces-1; break; }
--- a/mm.c Thu Jul 19 14:48:13 2007 +0000 +++ b/mm.c Thu Jul 19 15:21:30 2007 +0000 @@ -95,7 +95,7 @@ /* video stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MMVIDEO; st->codec->codec_tag = 0; /* no fourcc */ @@ -108,7 +108,7 @@ if (length == MM_HEADER_LEN_AV) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->codec_id = CODEC_ID_PCM_U8; @@ -168,7 +168,7 @@ case MM_TYPE_INTER_HHV : /* output preamble + data */ if (av_new_packet(pkt, length + MM_PREAMBLE_SIZE)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE); if (get_buffer(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length) return AVERROR_IO; @@ -179,7 +179,7 @@ case MM_TYPE_AUDIO : if (av_get_packet(&s->pb, pkt, length)<0) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); pkt->size = length; pkt->stream_index = 1; pkt->pts = mm->audio_pts++;
--- a/mmf.c Thu Jul 19 14:48:13 2007 +0000 +++ b/mmf.c Thu Jul 19 15:21:30 2007 +0000 @@ -242,7 +242,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA;
--- a/mp3.c Thu Jul 19 14:48:13 2007 +0000 +++ b/mp3.c Thu Jul 19 15:21:30 2007 +0000 @@ -433,7 +433,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MP3;
--- a/mpc.c Thu Jul 19 14:48:13 2007 +0000 +++ b/mpc.c Thu Jul 19 15:21:30 2007 +0000 @@ -92,7 +92,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MUSEPACK7; st->codec->channels = 2;
--- a/mtv.c Thu Jul 19 14:48:13 2007 +0000 +++ b/mtv.c Thu Jul 19 15:21:30 2007 +0000 @@ -96,7 +96,7 @@ st = av_new_stream(s, VIDEO_SID); if(!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, mtv->video_fps); st->codec->codec_type = CODEC_TYPE_VIDEO; @@ -111,7 +111,7 @@ st = av_new_stream(s, AUDIO_SID); if(!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE); st->codec->codec_type = CODEC_TYPE_AUDIO;
--- a/nut.c Thu Jul 19 14:48:13 2007 +0000 +++ b/nut.c Thu Jul 19 15:21:30 2007 +0000 @@ -952,7 +952,7 @@ st = av_new_stream(s, stream_id); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); class = get_v(bc); tmp = get_vb(bc);
--- a/nutdec.c Thu Jul 19 14:48:13 2007 +0000 +++ b/nutdec.c Thu Jul 19 15:21:30 2007 +0000 @@ -293,7 +293,7 @@ st = s->streams[stream_id]; if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); class = get_v(bc); tmp = get_fourcc(bc);
--- a/ogg.c Thu Jul 19 14:48:13 2007 +0000 +++ b/ogg.c Thu Jul 19 15:21:30 2007 +0000 @@ -216,7 +216,7 @@ ast = av_new_stream(avfcontext, 0) ; if(!ast) - return AVERROR_NOMEM ; + return AVERROR(ENOMEM) ; av_set_pts_info(ast, 60, 1, AV_TIME_BASE); codec= &ast->codec;
--- a/ogg2.c Thu Jul 19 14:48:13 2007 +0000 +++ b/ogg2.c Thu Jul 19 15:21:30 2007 +0000 @@ -200,7 +200,7 @@ st = av_new_stream (s, idx); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, 1000000);
--- a/psxstr.c Thu Jul 19 14:48:13 2007 +0000 +++ b/psxstr.c Thu Jul 19 15:21:30 2007 +0000 @@ -178,7 +178,7 @@ /* allocate a new AVStream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, 15); str->channels[channel].video_stream_index = st->index; @@ -207,7 +207,7 @@ /* allocate a new AVStream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, 128, str->channels[channel].sample_rate); str->channels[channel].audio_stream_index = st->index;
--- a/raw.c Thu Jul 19 14:48:13 2007 +0000 +++ b/raw.c Thu Jul 19 15:21:30 2007 +0000 @@ -72,7 +72,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); id = s->iformat->value; if (id == CODEC_ID_RAWVIDEO) { @@ -222,7 +222,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_AC3; @@ -238,7 +238,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_SHORTEN; st->need_parsing = AVSTREAM_PARSE_FULL; @@ -254,7 +254,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_FLAC; st->need_parsing = AVSTREAM_PARSE_FULL; @@ -270,7 +270,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_DTS; @@ -287,7 +287,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_AAC; @@ -304,7 +304,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = s->iformat->value;
--- a/rtsp.c Thu Jul 19 14:48:13 2007 +0000 +++ b/rtsp.c Thu Jul 19 15:21:30 2007 +0000 @@ -1044,7 +1044,7 @@ rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); if (!rtsp_st->rtp_ctx) { - err = AVERROR_NOMEM; + err = AVERROR(ENOMEM); goto fail; } else { if(rtsp_st->dynamic_handler) { @@ -1384,7 +1384,7 @@ s->ctx_flags |= AVFMTCTX_NOHEADER; rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); if (!rtsp_st->rtp_ctx) { - err = AVERROR_NOMEM; + err = AVERROR(ENOMEM); goto fail; } else { if(rtsp_st->dynamic_handler) {
--- a/segafilm.c Thu Jul 19 14:48:13 2007 +0000 +++ b/segafilm.c Thu Jul 19 15:21:30 2007 +0000 @@ -130,7 +130,7 @@ if (film->video_type) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); film->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = film->video_type; @@ -142,7 +142,7 @@ if (film->audio_type) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); film->audio_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = film->audio_type; @@ -223,14 +223,14 @@ (film->video_type == CODEC_ID_CINEPAK)) { pkt->pos= url_ftell(pb); if (av_new_packet(pkt, sample->sample_size)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); get_buffer(pb, pkt->data, sample->sample_size); } else if ((sample->stream == film->audio_stream_index) && (film->audio_channels == 2)) { /* stereo PCM needs to be interleaved */ if (av_new_packet(pkt, sample->sample_size)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); /* make sure the interleave buffer is large enough */ if (sample->sample_size > film->stereo_buffer_size) {
--- a/sierravmd.c Thu Jul 19 14:48:13 2007 +0000 +++ b/sierravmd.c Thu Jul 19 15:21:30 2007 +0000 @@ -94,7 +94,7 @@ /* start up the decoders */ vst = av_new_stream(s, 0); if (!vst) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(vst, 33, 1, 10); vmd->video_stream_index = vst->index; vst->codec->codec_type = CODEC_TYPE_VIDEO; @@ -111,7 +111,7 @@ if (vmd->sample_rate) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); vmd->audio_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_VMDAUDIO; @@ -155,7 +155,7 @@ if (!raw_frame_table || !vmd->frame_table) { av_free(raw_frame_table); av_free(vmd->frame_table); - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if (get_buffer(pb, raw_frame_table, raw_frame_table_size) != raw_frame_table_size) { @@ -257,7 +257,7 @@ url_fseek(pb, frame->frame_offset, SEEK_SET); if (av_new_packet(pkt, frame->frame_size + BYTES_PER_FRAME_RECORD)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); pkt->pos= url_ftell(pb); memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD); ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD,
--- a/smacker.c Thu Jul 19 14:48:13 2007 +0000 +++ b/smacker.c Thu Jul 19 15:21:30 2007 +0000 @@ -290,7 +290,7 @@ flags >>= 1; } if (av_new_packet(pkt, frame_size + 768)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); if(smk->frm_size[smk->cur_frame] & 1) palchange |= 2; pkt->data[0] = palchange; @@ -304,7 +304,7 @@ smk->nextpos = url_ftell(&s->pb); } else { if (av_new_packet(pkt, smk->buf_sizes[smk->curstream])) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); memcpy(pkt->data, smk->bufs[smk->curstream], smk->buf_sizes[smk->curstream]); pkt->size = smk->buf_sizes[smk->curstream]; pkt->stream_index = smk->stream_id[smk->curstream];
--- a/thp.c Thu Jul 19 14:48:13 2007 +0000 +++ b/thp.c Thu Jul 19 15:21:30 2007 +0000 @@ -96,7 +96,7 @@ /* Video component. */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); /* The denominator and numerator are switched because 1/fps is required. */ @@ -119,7 +119,7 @@ /* Audio component. */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_THP;
--- a/tiertexseq.c Thu Jul 19 14:48:13 2007 +0000 +++ b/tiertexseq.c Thu Jul 19 15:21:30 2007 +0000 @@ -95,7 +95,7 @@ seq_buffer->data_size = sz; seq_buffer->data = av_malloc(sz); if (!seq_buffer->data) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } } seq->frame_buffers_count = i; @@ -208,7 +208,7 @@ /* initialize the video decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 32, 1, SEQ_FRAME_RATE); seq->video_stream_index = st->index; @@ -221,7 +221,7 @@ /* initialize the audio decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 32, 1, SEQ_SAMPLE_RATE); seq->audio_stream_index = st->index; @@ -251,7 +251,7 @@ /* video packet */ if (seq->current_pal_data_size + seq->current_video_data_size != 0) { if (av_new_packet(pkt, 1 + seq->current_pal_data_size + seq->current_video_data_size)) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); pkt->data[0] = 0; if (seq->current_pal_data_size != 0) {
--- a/tta.c Thu Jul 19 14:48:13 2007 +0000 +++ b/tta.c Thu Jul 19 15:21:30 2007 +0000 @@ -71,7 +71,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, samplerate); st->start_time = 0;
--- a/txd.c Thu Jul 19 14:48:13 2007 +0000 +++ b/txd.c Thu Jul 19 15:21:30 2007 +0000 @@ -41,7 +41,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_TXD; st->codec->time_base.den = 5;
--- a/utils.c Thu Jul 19 14:48:13 2007 +0000 +++ b/utils.c Thu Jul 19 15:21:30 2007 +0000 @@ -195,10 +195,10 @@ { uint8_t *data; if((unsigned)size > (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); if (!data) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); av_init_packet(pkt); @@ -233,10 +233,10 @@ /* we duplicate the packet and don't forget to put the padding again */ if((unsigned)pkt->size > (unsigned)pkt->size + FF_INPUT_BUFFER_PADDING_SIZE) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); data = av_malloc(pkt->size + FF_INPUT_BUFFER_PADDING_SIZE); if (!data) { - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } memcpy(data, pkt->data, pkt->size); memset(data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); @@ -358,7 +358,7 @@ else ic = *ic_ptr; if (!ic) { - err = AVERROR_NOMEM; + err = AVERROR(ENOMEM); goto fail; } ic->iformat = fmt; @@ -372,7 +372,7 @@ if (fmt->priv_data_size > 0) { ic->priv_data = av_mallocz(fmt->priv_data_size); if (!ic->priv_data) { - err = AVERROR_NOMEM; + err = AVERROR(ENOMEM); goto fail; } } else { @@ -868,13 +868,13 @@ /* duplicate the packet */ if (av_dup_packet(pkt) < 0) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); while(*plast_pktl) plast_pktl= &(*plast_pktl)->next; //FIXME maybe maintain pointer to the last? pktl = av_mallocz(sizeof(AVPacketList)); if (!pktl) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); /* add the packet in the buffered packet list */ *plast_pktl = pktl; @@ -1727,7 +1727,7 @@ int codec_identified[MAX_STREAMS]={0}; duration_error = av_mallocz(MAX_STREAMS * sizeof(*duration_error)); - if (!duration_error) return AVERROR_NOMEM; + if (!duration_error) return AVERROR(ENOMEM); for(i=0;i<ic->nb_streams;i++) { st = ic->streams[i]; @@ -1807,7 +1807,7 @@ pktl = av_mallocz(sizeof(AVPacketList)); if (!pktl) { - ret = AVERROR_NOMEM; + ret = AVERROR(ENOMEM); break; } @@ -1820,7 +1820,7 @@ /* duplicate the packet */ if (av_dup_packet(pkt) < 0) { - ret = AVERROR_NOMEM; + ret = AVERROR(ENOMEM); break; } @@ -2088,7 +2088,7 @@ if (s->oformat->priv_data_size > 0) { s->priv_data = av_mallocz(s->oformat->priv_data_size); if (!s->priv_data) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } else s->priv_data = NULL; @@ -2143,7 +2143,7 @@ if (!s->priv_data && s->oformat->priv_data_size > 0) { s->priv_data = av_mallocz(s->oformat->priv_data_size); if (!s->priv_data) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if(s->oformat->write_header){
--- a/vocdec.c Thu Jul 19 14:48:13 2007 +0000 +++ b/vocdec.c Thu Jul 19 15:21:30 2007 +0000 @@ -52,7 +52,7 @@ url_fskip(pb, header_size); st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; voc->remaining_size = 0;
--- a/wav.c Thu Jul 19 14:48:13 2007 +0000 +++ b/wav.c Thu Jul 19 15:21:30 2007 +0000 @@ -176,7 +176,7 @@ return -1; st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); get_wav_header(pb, st->codec, size); st->need_parsing = AVSTREAM_PARSE_FULL;
--- a/wc3movie.c Thu Jul 19 14:48:13 2007 +0000 +++ b/wc3movie.c Thu Jul 19 15:21:30 2007 +0000 @@ -238,7 +238,7 @@ /* initialize the decoder streams */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); wc3->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; @@ -252,7 +252,7 @@ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, 90000); wc3->audio_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_AUDIO;
--- a/westwood.c Thu Jul 19 14:48:13 2007 +0000 +++ b/westwood.c Thu Jul 19 15:21:30 2007 +0000 @@ -138,7 +138,7 @@ /* initialize the audio decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, wsaud->audio_samplerate); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = wsaud->audio_type; @@ -223,7 +223,7 @@ /* initialize the video decoder stream */ st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, VQA_FRAMERATE); wsvqa->video_stream_index = st->index; st->codec->codec_type = CODEC_TYPE_VIDEO; @@ -249,7 +249,7 @@ if (AV_RL16(&header[24]) || (AV_RL16(&header[0]) == 1 && AV_RL16(&header[2]) == 1)) { st = av_new_stream(s, 0); if (!st) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, VQA_FRAMERATE); st->codec->codec_type = CODEC_TYPE_AUDIO; if (AV_RL16(&header[0]) == 1)
--- a/wv.c Thu Jul 19 14:48:13 2007 +0000 +++ b/wv.c Thu Jul 19 15:21:30 2007 +0000 @@ -177,7 +177,7 @@ } if(av_new_packet(pkt, wc->blksize + WV_EXTRA_SIZE) < 0) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); memcpy(pkt->data, wc->extra, WV_EXTRA_SIZE); ret = get_buffer(&s->pb, pkt->data + WV_EXTRA_SIZE, wc->blksize); if(ret != wc->blksize){