Originally committed as revision 9759 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -138,7 +138,7 @@ void print_error(const char *filename, int err) |
| 138 | 138 |
"Usually that means that input file is truncated and/or corrupted.\n", |
| 139 | 139 |
filename); |
| 140 | 140 |
break; |
| 141 |
- case AVERROR_NOMEM: |
|
| 141 |
+ case AVERROR(ENOMEM): |
|
| 142 | 142 |
fprintf(stderr, "%s: memory allocation error occured\n", filename); |
| 143 | 143 |
break; |
| 144 | 144 |
case AVERROR_NOENT: |
| ... | ... |
@@ -116,7 +116,7 @@ static int fourxm_read_header(AVFormatContext *s, |
| 116 | 116 |
/* allocate space for the header and load the whole thing */ |
| 117 | 117 |
header = av_malloc(header_size); |
| 118 | 118 |
if (!header) |
| 119 |
- return AVERROR_NOMEM; |
|
| 119 |
+ return AVERROR(ENOMEM); |
|
| 120 | 120 |
if (get_buffer(pb, header, header_size) != header_size) |
| 121 | 121 |
return AVERROR_IO; |
| 122 | 122 |
|
| ... | ... |
@@ -140,7 +140,7 @@ static int fourxm_read_header(AVFormatContext *s, |
| 140 | 140 |
/* allocate a new AVStream */ |
| 141 | 141 |
st = av_new_stream(s, 0); |
| 142 | 142 |
if (!st) |
| 143 |
- return AVERROR_NOMEM; |
|
| 143 |
+ return AVERROR(ENOMEM); |
|
| 144 | 144 |
av_set_pts_info(st, 60, 1, fourxm->fps); |
| 145 | 145 |
|
| 146 | 146 |
fourxm->video_stream_index = st->index; |
| ... | ... |
@@ -166,7 +166,7 @@ static int fourxm_read_header(AVFormatContext *s, |
| 166 | 166 |
fourxm->track_count * sizeof(AudioTrack)); |
| 167 | 167 |
if (!fourxm->tracks) {
|
| 168 | 168 |
av_free(header); |
| 169 |
- return AVERROR_NOMEM; |
|
| 169 |
+ return AVERROR(ENOMEM); |
|
| 170 | 170 |
} |
| 171 | 171 |
} |
| 172 | 172 |
fourxm->tracks[current_track].adpcm = AV_RL32(&header[i + 12]); |
| ... | ... |
@@ -178,7 +178,7 @@ static int fourxm_read_header(AVFormatContext *s, |
| 178 | 178 |
/* allocate a new AVStream */ |
| 179 | 179 |
st = av_new_stream(s, current_track); |
| 180 | 180 |
if (!st) |
| 181 |
- return AVERROR_NOMEM; |
|
| 181 |
+ return AVERROR(ENOMEM); |
|
| 182 | 182 |
|
| 183 | 183 |
av_set_pts_info(st, 60, 1, fourxm->tracks[current_track].sample_rate); |
| 184 | 184 |
|
| ... | ... |
@@ -41,7 +41,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 41 | 41 |
|
| 42 | 42 |
st = av_new_stream(s, 0); |
| 43 | 43 |
if (!st) |
| 44 |
- return AVERROR_NOMEM; |
|
| 44 |
+ return AVERROR(ENOMEM); |
|
| 45 | 45 |
|
| 46 | 46 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 47 | 47 |
st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS; |
| ... | ... |
@@ -53,7 +53,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 53 | 53 |
st->codec->extradata = av_malloc(st->codec->extradata_size + |
| 54 | 54 |
FF_INPUT_BUFFER_PADDING_SIZE); |
| 55 | 55 |
if (!st->codec->extradata) |
| 56 |
- return AVERROR_NOMEM; |
|
| 56 |
+ return AVERROR(ENOMEM); |
|
| 57 | 57 |
|
| 58 | 58 |
/* initial predictor values for adpcm decoder */ |
| 59 | 59 |
get_buffer(pb, st->codec->extradata, 2 * 4); |
| ... | ... |
@@ -176,7 +176,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) |
| 176 | 176 |
if (!avs->st_video) {
|
| 177 | 177 |
avs->st_video = av_new_stream(s, AVS_VIDEO); |
| 178 | 178 |
if (avs->st_video == NULL) |
| 179 |
- return AVERROR_NOMEM; |
|
| 179 |
+ return AVERROR(ENOMEM); |
|
| 180 | 180 |
avs->st_video->codec->codec_type = CODEC_TYPE_VIDEO; |
| 181 | 181 |
avs->st_video->codec->codec_id = CODEC_ID_AVS; |
| 182 | 182 |
avs->st_video->codec->width = avs->width; |
| ... | ... |
@@ -193,7 +193,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) |
| 193 | 193 |
if (!avs->st_audio) {
|
| 194 | 194 |
avs->st_audio = av_new_stream(s, AVS_AUDIO); |
| 195 | 195 |
if (avs->st_audio == NULL) |
| 196 |
- return AVERROR_NOMEM; |
|
| 196 |
+ return AVERROR(ENOMEM); |
|
| 197 | 197 |
avs->st_audio->codec->codec_type = CODEC_TYPE_AUDIO; |
| 198 | 198 |
} |
| 199 | 199 |
avs->remaining_audio_size = size - 4; |
| ... | ... |
@@ -71,7 +71,7 @@ static int vid_read_header(AVFormatContext *s, |
| 71 | 71 |
|
| 72 | 72 |
stream = av_new_stream(s, 0); |
| 73 | 73 |
if (!stream) |
| 74 |
- return AVERROR_NOMEM; |
|
| 74 |
+ return AVERROR(ENOMEM); |
|
| 75 | 75 |
av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps |
| 76 | 76 |
stream->codec->codec_type = CODEC_TYPE_VIDEO; |
| 77 | 77 |
stream->codec->codec_id = CODEC_ID_BETHSOFTVID; |
| ... | ... |
@@ -84,7 +84,7 @@ static int vid_read_header(AVFormatContext *s, |
| 84 | 84 |
// done with video codec, set up audio codec |
| 85 | 85 |
stream = av_new_stream(s, 0); |
| 86 | 86 |
if (!stream) |
| 87 |
- return AVERROR_NOMEM; |
|
| 87 |
+ return AVERROR(ENOMEM); |
|
| 88 | 88 |
stream->codec->codec_type = CODEC_TYPE_AUDIO; |
| 89 | 89 |
stream->codec->codec_id = CODEC_ID_PCM_U8; |
| 90 | 90 |
stream->codec->channels = 1; |
| ... | ... |
@@ -108,7 +108,7 @@ static int read_frame(BVID_DemuxContext *vid, ByteIOContext *pb, AVPacket *pkt, |
| 108 | 108 |
|
| 109 | 109 |
vidbuf_start = av_malloc(vidbuf_capacity = BUFFER_PADDING_SIZE); |
| 110 | 110 |
if(!vidbuf_start) |
| 111 |
- return AVERROR_NOMEM; |
|
| 111 |
+ return AVERROR(ENOMEM); |
|
| 112 | 112 |
|
| 113 | 113 |
// save the file position for the packet, include block type |
| 114 | 114 |
position = url_ftell(pb) - 1; |
| ... | ... |
@@ -128,7 +128,7 @@ static int read_frame(BVID_DemuxContext *vid, ByteIOContext *pb, AVPacket *pkt, |
| 128 | 128 |
do{
|
| 129 | 129 |
vidbuf_start = av_fast_realloc(vidbuf_start, &vidbuf_capacity, vidbuf_nbytes + BUFFER_PADDING_SIZE); |
| 130 | 130 |
if(!vidbuf_start) |
| 131 |
- return AVERROR_NOMEM; |
|
| 131 |
+ return AVERROR(ENOMEM); |
|
| 132 | 132 |
|
| 133 | 133 |
code = get_byte(pb); |
| 134 | 134 |
vidbuf_start[vidbuf_nbytes++] = code; |
| ... | ... |
@@ -77,7 +77,7 @@ static int read_header(AVFormatContext *s, |
| 77 | 77 |
|
| 78 | 78 |
video = av_new_stream(s, 0); |
| 79 | 79 |
if (!video) |
| 80 |
- return AVERROR_NOMEM; |
|
| 80 |
+ return AVERROR(ENOMEM); |
|
| 81 | 81 |
|
| 82 | 82 |
video->codec->codec_type = CODEC_TYPE_VIDEO; |
| 83 | 83 |
video->codec->codec_id = CODEC_ID_C93; |
| ... | ... |
@@ -115,7 +115,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 115 | 115 |
if (!c93->audio) {
|
| 116 | 116 |
c93->audio = av_new_stream(s, 1); |
| 117 | 117 |
if (!c93->audio) |
| 118 |
- return AVERROR_NOMEM; |
|
| 118 |
+ return AVERROR(ENOMEM); |
|
| 119 | 119 |
c93->audio->codec->codec_type = CODEC_TYPE_AUDIO; |
| 120 | 120 |
} |
| 121 | 121 |
url_fskip(pb, 26); /* VOC header */ |
| ... | ... |
@@ -108,7 +108,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 108 | 108 |
/* initialize the video decoder stream */ |
| 109 | 109 |
st = av_new_stream(s, 0); |
| 110 | 110 |
if (!st) |
| 111 |
- return AVERROR_NOMEM; |
|
| 111 |
+ return AVERROR(ENOMEM); |
|
| 112 | 112 |
|
| 113 | 113 |
av_set_pts_info(st, 32, 1, 12); |
| 114 | 114 |
cin->video_stream_index = st->index; |
| ... | ... |
@@ -121,7 +121,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 121 | 121 |
/* initialize the audio decoder stream */ |
| 122 | 122 |
st = av_new_stream(s, 0); |
| 123 | 123 |
if (!st) |
| 124 |
- return AVERROR_NOMEM; |
|
| 124 |
+ return AVERROR(ENOMEM); |
|
| 125 | 125 |
|
| 126 | 126 |
av_set_pts_info(st, 32, 1, 22050); |
| 127 | 127 |
cin->audio_stream_index = st->index; |
| ... | ... |
@@ -178,7 +178,7 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 178 | 178 |
pkt_size = (palette_type + 3) * hdr->pal_colors_count + hdr->video_frame_size; |
| 179 | 179 |
|
| 180 | 180 |
if (av_new_packet(pkt, 4 + pkt_size)) |
| 181 |
- return AVERROR_NOMEM; |
|
| 181 |
+ return AVERROR(ENOMEM); |
|
| 182 | 182 |
|
| 183 | 183 |
pkt->stream_index = cin->video_stream_index; |
| 184 | 184 |
pkt->pts = cin->video_stream_pts++; |
| ... | ... |
@@ -198,7 +198,7 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 198 | 198 |
|
| 199 | 199 |
/* audio packet */ |
| 200 | 200 |
if (av_new_packet(pkt, cin->audio_buffer_size)) |
| 201 |
- return AVERROR_NOMEM; |
|
| 201 |
+ return AVERROR(ENOMEM); |
|
| 202 | 202 |
|
| 203 | 203 |
pkt->stream_index = cin->audio_stream_index; |
| 204 | 204 |
pkt->pts = cin->audio_stream_pts; |
| ... | ... |
@@ -160,7 +160,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 160 | 160 |
switch(AV_RL32(buf)){
|
| 161 | 161 |
case MKTAG('N', 'U', 'L', 'L'):
|
| 162 | 162 |
if(av_new_packet(pkt, 4 + pal_size) < 0) |
| 163 |
- return AVERROR_NOMEM; |
|
| 163 |
+ return AVERROR(ENOMEM); |
|
| 164 | 164 |
pkt->stream_index = 0; |
| 165 | 165 |
if(pal_size) memcpy(pkt->data, pal, pal_size); |
| 166 | 166 |
memcpy(pkt->data + pal_size, buf, 4); |
| ... | ... |
@@ -181,7 +181,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 181 | 181 |
return -1; |
| 182 | 182 |
} |
| 183 | 183 |
if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) |
| 184 |
- return AVERROR_NOMEM; |
|
| 184 |
+ return AVERROR(ENOMEM); |
|
| 185 | 185 |
memcpy(pkt->data + pal_size, buf, DXA_EXTRA_SIZE); |
| 186 | 186 |
ret = get_buffer(&s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size); |
| 187 | 187 |
if(ret != size){
|
| ... | ... |
@@ -184,7 +184,7 @@ static int ea_read_header(AVFormatContext *s, |
| 184 | 184 |
/* initialize the video decoder stream */ |
| 185 | 185 |
st = av_new_stream(s, 0); |
| 186 | 186 |
if (!st) |
| 187 |
- return AVERROR_NOMEM; |
|
| 187 |
+ return AVERROR(ENOMEM); |
|
| 188 | 188 |
av_set_pts_info(st, 33, 1, 90000); |
| 189 | 189 |
ea->video_stream_index = st->index; |
| 190 | 190 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -195,7 +195,7 @@ static int ea_read_header(AVFormatContext *s, |
| 195 | 195 |
/* initialize the audio decoder stream */ |
| 196 | 196 |
st = av_new_stream(s, 0); |
| 197 | 197 |
if (!st) |
| 198 |
- return AVERROR_NOMEM; |
|
| 198 |
+ return AVERROR(ENOMEM); |
|
| 199 | 199 |
av_set_pts_info(st, 33, 1, EA_SAMPLE_RATE); |
| 200 | 200 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 201 | 201 |
st->codec->codec_id = CODEC_ID_ADPCM_EA; |
| ... | ... |
@@ -86,7 +86,7 @@ static int flic_read_header(AVFormatContext *s, |
| 86 | 86 |
/* initialize the decoder streams */ |
| 87 | 87 |
st = av_new_stream(s, 0); |
| 88 | 88 |
if (!st) |
| 89 |
- return AVERROR_NOMEM; |
|
| 89 |
+ return AVERROR(ENOMEM); |
|
| 90 | 90 |
flic->video_stream_index = st->index; |
| 91 | 91 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| 92 | 92 |
st->codec->codec_id = CODEC_ID_FLIC; |
| ... | ... |
@@ -237,14 +237,14 @@ static int flv_read_header(AVFormatContext *s, |
| 237 | 237 |
if(flags & FLV_HEADER_FLAG_HASVIDEO){
|
| 238 | 238 |
st = av_new_stream(s, 0); |
| 239 | 239 |
if (!st) |
| 240 |
- return AVERROR_NOMEM; |
|
| 240 |
+ return AVERROR(ENOMEM); |
|
| 241 | 241 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| 242 | 242 |
av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */ |
| 243 | 243 |
} |
| 244 | 244 |
if(flags & FLV_HEADER_FLAG_HASAUDIO){
|
| 245 | 245 |
st = av_new_stream(s, 1); |
| 246 | 246 |
if (!st) |
| 247 |
- return AVERROR_NOMEM; |
|
| 247 |
+ return AVERROR(ENOMEM); |
|
| 248 | 248 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 249 | 249 |
av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */ |
| 250 | 250 |
} |
| ... | ... |
@@ -151,7 +151,7 @@ static int idcin_read_header(AVFormatContext *s, |
| 151 | 151 |
|
| 152 | 152 |
st = av_new_stream(s, 0); |
| 153 | 153 |
if (!st) |
| 154 |
- return AVERROR_NOMEM; |
|
| 154 |
+ return AVERROR(ENOMEM); |
|
| 155 | 155 |
av_set_pts_info(st, 33, 1, 90000); |
| 156 | 156 |
idcin->video_stream_index = st->index; |
| 157 | 157 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -174,7 +174,7 @@ static int idcin_read_header(AVFormatContext *s, |
| 174 | 174 |
idcin->audio_present = 1; |
| 175 | 175 |
st = av_new_stream(s, 0); |
| 176 | 176 |
if (!st) |
| 177 |
- return AVERROR_NOMEM; |
|
| 177 |
+ return AVERROR(ENOMEM); |
|
| 178 | 178 |
av_set_pts_info(st, 33, 1, 90000); |
| 179 | 179 |
idcin->audio_stream_index = st->index; |
| 180 | 180 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -140,7 +140,7 @@ static int roq_read_header(AVFormatContext *s, |
| 140 | 140 |
/* initialize the decoders */ |
| 141 | 141 |
st = av_new_stream(s, 0); |
| 142 | 142 |
if (!st) |
| 143 |
- return AVERROR_NOMEM; |
|
| 143 |
+ return AVERROR(ENOMEM); |
|
| 144 | 144 |
/* set the pts reference (1 pts = 1/90000) */ |
| 145 | 145 |
av_set_pts_info(st, 33, 1, 90000); |
| 146 | 146 |
roq->video_stream_index = st->index; |
| ... | ... |
@@ -153,7 +153,7 @@ static int roq_read_header(AVFormatContext *s, |
| 153 | 153 |
if (roq->audio_channels) {
|
| 154 | 154 |
st = av_new_stream(s, 0); |
| 155 | 155 |
if (!st) |
| 156 |
- return AVERROR_NOMEM; |
|
| 156 |
+ return AVERROR(ENOMEM); |
|
| 157 | 157 |
av_set_pts_info(st, 33, 1, 90000); |
| 158 | 158 |
roq->audio_stream_index = st->index; |
| 159 | 159 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -551,7 +551,7 @@ static int ipmovie_read_header(AVFormatContext *s, |
| 551 | 551 |
/* initialize the stream decoders */ |
| 552 | 552 |
st = av_new_stream(s, 0); |
| 553 | 553 |
if (!st) |
| 554 |
- return AVERROR_NOMEM; |
|
| 554 |
+ return AVERROR(ENOMEM); |
|
| 555 | 555 |
av_set_pts_info(st, 33, 1, 90000); |
| 556 | 556 |
ipmovie->video_stream_index = st->index; |
| 557 | 557 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -566,7 +566,7 @@ static int ipmovie_read_header(AVFormatContext *s, |
| 566 | 566 |
if (ipmovie->audio_type) {
|
| 567 | 567 |
st = av_new_stream(s, 0); |
| 568 | 568 |
if (!st) |
| 569 |
- return AVERROR_NOMEM; |
|
| 569 |
+ return AVERROR(ENOMEM); |
|
| 570 | 570 |
av_set_pts_info(st, 33, 1, 90000); |
| 571 | 571 |
ipmovie->audio_stream_index = st->index; |
| 572 | 572 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -598,7 +598,7 @@ static int ipmovie_read_packet(AVFormatContext *s, |
| 598 | 598 |
else if (ret == CHUNK_EOF) |
| 599 | 599 |
ret = AVERROR_IO; |
| 600 | 600 |
else if (ret == CHUNK_NOMEM) |
| 601 |
- ret = AVERROR_NOMEM; |
|
| 601 |
+ ret = AVERROR(ENOMEM); |
|
| 602 | 602 |
else if (ret == CHUNK_VIDEO) |
| 603 | 603 |
ret = 0; |
| 604 | 604 |
else |
| ... | ... |
@@ -485,7 +485,7 @@ ebml_read_ascii (MatroskaDemuxContext *matroska, |
| 485 | 485 |
* byte more, read the string and NULL-terminate it ourselves. */ |
| 486 | 486 |
if (size < 0 || !(*str = av_malloc(size + 1))) {
|
| 487 | 487 |
av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation failed\n"); |
| 488 |
- return AVERROR_NOMEM; |
|
| 488 |
+ return AVERROR(ENOMEM); |
|
| 489 | 489 |
} |
| 490 | 490 |
if (get_buffer(pb, (uint8_t *) *str, size) != size) {
|
| 491 | 491 |
offset_t pos = url_ftell(pb); |
| ... | ... |
@@ -581,7 +581,7 @@ ebml_read_binary (MatroskaDemuxContext *matroska, |
| 581 | 581 |
if (!(*binary = av_malloc(*size))) {
|
| 582 | 582 |
av_log(matroska->ctx, AV_LOG_ERROR, |
| 583 | 583 |
"Memory allocation error\n"); |
| 584 |
- return AVERROR_NOMEM; |
|
| 584 |
+ return AVERROR(ENOMEM); |
|
| 585 | 585 |
} |
| 586 | 586 |
|
| 587 | 587 |
if (get_buffer(pb, *binary, *size) != *size) {
|
| ... | ... |
@@ -2074,7 +2074,7 @@ matroska_read_header (AVFormatContext *s, |
| 2074 | 2074 |
int sri = matroska_aac_sri(audiotrack->internal_samplerate); |
| 2075 | 2075 |
extradata = av_malloc(5); |
| 2076 | 2076 |
if (extradata == NULL) |
| 2077 |
- return AVERROR_NOMEM; |
|
| 2077 |
+ return AVERROR(ENOMEM); |
|
| 2078 | 2078 |
extradata[0] = (profile << 3) | ((sri&0x0E) >> 1); |
| 2079 | 2079 |
extradata[1] = ((sri&0x01) << 7) | (audiotrack->channels<<3); |
| 2080 | 2080 |
if (strstr(track->codec_id, "SBR")) {
|
| ... | ... |
@@ -2095,7 +2095,7 @@ matroska_read_header (AVFormatContext *s, |
| 2095 | 2095 |
extradata_size = 30; |
| 2096 | 2096 |
extradata = av_mallocz(extradata_size); |
| 2097 | 2097 |
if (extradata == NULL) |
| 2098 |
- return AVERROR_NOMEM; |
|
| 2098 |
+ return AVERROR(ENOMEM); |
|
| 2099 | 2099 |
init_put_byte(&b, extradata, extradata_size, 1, |
| 2100 | 2100 |
NULL, NULL, NULL, NULL); |
| 2101 | 2101 |
put_buffer(&b, (uint8_t *) "TTA1", 4); |
| ... | ... |
@@ -2164,7 +2164,7 @@ matroska_read_header (AVFormatContext *s, |
| 2164 | 2164 |
matroska->num_streams++; |
| 2165 | 2165 |
st = av_new_stream(s, track->stream_index); |
| 2166 | 2166 |
if (st == NULL) |
| 2167 |
- return AVERROR_NOMEM; |
|
| 2167 |
+ return AVERROR(ENOMEM); |
|
| 2168 | 2168 |
av_set_pts_info(st, 64, matroska->time_scale, 1000*1000*1000); /* 64 bit pts in ns */ |
| 2169 | 2169 |
|
| 2170 | 2170 |
st->codec->codec_id = codec_id; |
| ... | ... |
@@ -2182,7 +2182,7 @@ matroska_read_header (AVFormatContext *s, |
| 2182 | 2182 |
} else if(track->codec_priv && track->codec_priv_size > 0){
|
| 2183 | 2183 |
st->codec->extradata = av_malloc(track->codec_priv_size); |
| 2184 | 2184 |
if(st->codec->extradata == NULL) |
| 2185 |
- return AVERROR_NOMEM; |
|
| 2185 |
+ return AVERROR(ENOMEM); |
|
| 2186 | 2186 |
st->codec->extradata_size = track->codec_priv_size; |
| 2187 | 2187 |
memcpy(st->codec->extradata,track->codec_priv+extradata_offset, |
| 2188 | 2188 |
track->codec_priv_size); |
| ... | ... |
@@ -2451,7 +2451,7 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, |
| 2451 | 2451 |
pkt = av_mallocz(sizeof(AVPacket)); |
| 2452 | 2452 |
/* XXX: prevent data copy... */ |
| 2453 | 2453 |
if (av_new_packet(pkt, slice_size-offset) < 0) {
|
| 2454 |
- res = AVERROR_NOMEM; |
|
| 2454 |
+ res = AVERROR(ENOMEM); |
|
| 2455 | 2455 |
n = laces-1; |
| 2456 | 2456 |
break; |
| 2457 | 2457 |
} |
| ... | ... |
@@ -95,7 +95,7 @@ static int mm_read_header(AVFormatContext *s, |
| 95 | 95 |
/* video stream */ |
| 96 | 96 |
st = av_new_stream(s, 0); |
| 97 | 97 |
if (!st) |
| 98 |
- return AVERROR_NOMEM; |
|
| 98 |
+ return AVERROR(ENOMEM); |
|
| 99 | 99 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| 100 | 100 |
st->codec->codec_id = CODEC_ID_MMVIDEO; |
| 101 | 101 |
st->codec->codec_tag = 0; /* no fourcc */ |
| ... | ... |
@@ -108,7 +108,7 @@ static int mm_read_header(AVFormatContext *s, |
| 108 | 108 |
if (length == MM_HEADER_LEN_AV) {
|
| 109 | 109 |
st = av_new_stream(s, 0); |
| 110 | 110 |
if (!st) |
| 111 |
- return AVERROR_NOMEM; |
|
| 111 |
+ return AVERROR(ENOMEM); |
|
| 112 | 112 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 113 | 113 |
st->codec->codec_tag = 0; /* no fourcc */ |
| 114 | 114 |
st->codec->codec_id = CODEC_ID_PCM_U8; |
| ... | ... |
@@ -168,7 +168,7 @@ static int mm_read_packet(AVFormatContext *s, |
| 168 | 168 |
case MM_TYPE_INTER_HHV : |
| 169 | 169 |
/* output preamble + data */ |
| 170 | 170 |
if (av_new_packet(pkt, length + MM_PREAMBLE_SIZE)) |
| 171 |
- return AVERROR_NOMEM; |
|
| 171 |
+ return AVERROR(ENOMEM); |
|
| 172 | 172 |
memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE); |
| 173 | 173 |
if (get_buffer(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length) |
| 174 | 174 |
return AVERROR_IO; |
| ... | ... |
@@ -179,7 +179,7 @@ static int mm_read_packet(AVFormatContext *s, |
| 179 | 179 |
|
| 180 | 180 |
case MM_TYPE_AUDIO : |
| 181 | 181 |
if (av_get_packet(&s->pb, pkt, length)<0) |
| 182 |
- return AVERROR_NOMEM; |
|
| 182 |
+ return AVERROR(ENOMEM); |
|
| 183 | 183 |
pkt->size = length; |
| 184 | 184 |
pkt->stream_index = 1; |
| 185 | 185 |
pkt->pts = mm->audio_pts++; |
| ... | ... |
@@ -242,7 +242,7 @@ static int mmf_read_header(AVFormatContext *s, |
| 242 | 242 |
|
| 243 | 243 |
st = av_new_stream(s, 0); |
| 244 | 244 |
if (!st) |
| 245 |
- return AVERROR_NOMEM; |
|
| 245 |
+ return AVERROR(ENOMEM); |
|
| 246 | 246 |
|
| 247 | 247 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 248 | 248 |
st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA; |
| ... | ... |
@@ -92,7 +92,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 92 | 92 |
|
| 93 | 93 |
st = av_new_stream(s, 0); |
| 94 | 94 |
if (!st) |
| 95 |
- return AVERROR_NOMEM; |
|
| 95 |
+ return AVERROR(ENOMEM); |
|
| 96 | 96 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 97 | 97 |
st->codec->codec_id = CODEC_ID_MUSEPACK7; |
| 98 | 98 |
st->codec->channels = 2; |
| ... | ... |
@@ -96,7 +96,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 96 | 96 |
|
| 97 | 97 |
st = av_new_stream(s, VIDEO_SID); |
| 98 | 98 |
if(!st) |
| 99 |
- return AVERROR_NOMEM; |
|
| 99 |
+ return AVERROR(ENOMEM); |
|
| 100 | 100 |
|
| 101 | 101 |
av_set_pts_info(st, 64, 1, mtv->video_fps); |
| 102 | 102 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -111,7 +111,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 111 | 111 |
|
| 112 | 112 |
st = av_new_stream(s, AUDIO_SID); |
| 113 | 113 |
if(!st) |
| 114 |
- return AVERROR_NOMEM; |
|
| 114 |
+ return AVERROR(ENOMEM); |
|
| 115 | 115 |
|
| 116 | 116 |
av_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE); |
| 117 | 117 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -216,7 +216,7 @@ static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap) |
| 216 | 216 |
|
| 217 | 217 |
ast = av_new_stream(avfcontext, 0) ; |
| 218 | 218 |
if(!ast) |
| 219 |
- return AVERROR_NOMEM ; |
|
| 219 |
+ return AVERROR(ENOMEM) ; |
|
| 220 | 220 |
av_set_pts_info(ast, 60, 1, AV_TIME_BASE); |
| 221 | 221 |
|
| 222 | 222 |
codec= &ast->codec; |
| ... | ... |
@@ -178,7 +178,7 @@ static int str_read_header(AVFormatContext *s, |
| 178 | 178 |
/* allocate a new AVStream */ |
| 179 | 179 |
st = av_new_stream(s, 0); |
| 180 | 180 |
if (!st) |
| 181 |
- return AVERROR_NOMEM; |
|
| 181 |
+ return AVERROR(ENOMEM); |
|
| 182 | 182 |
av_set_pts_info(st, 64, 1, 15); |
| 183 | 183 |
|
| 184 | 184 |
str->channels[channel].video_stream_index = st->index; |
| ... | ... |
@@ -207,7 +207,7 @@ static int str_read_header(AVFormatContext *s, |
| 207 | 207 |
/* allocate a new AVStream */ |
| 208 | 208 |
st = av_new_stream(s, 0); |
| 209 | 209 |
if (!st) |
| 210 |
- return AVERROR_NOMEM; |
|
| 210 |
+ return AVERROR(ENOMEM); |
|
| 211 | 211 |
av_set_pts_info(st, 64, 128, str->channels[channel].sample_rate); |
| 212 | 212 |
|
| 213 | 213 |
str->channels[channel].audio_stream_index = st->index; |
| ... | ... |
@@ -72,7 +72,7 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 72 | 72 |
|
| 73 | 73 |
st = av_new_stream(s, 0); |
| 74 | 74 |
if (!st) |
| 75 |
- return AVERROR_NOMEM; |
|
| 75 |
+ return AVERROR(ENOMEM); |
|
| 76 | 76 |
|
| 77 | 77 |
id = s->iformat->value; |
| 78 | 78 |
if (id == CODEC_ID_RAWVIDEO) {
|
| ... | ... |
@@ -222,7 +222,7 @@ static int ac3_read_header(AVFormatContext *s, |
| 222 | 222 |
|
| 223 | 223 |
st = av_new_stream(s, 0); |
| 224 | 224 |
if (!st) |
| 225 |
- return AVERROR_NOMEM; |
|
| 225 |
+ return AVERROR(ENOMEM); |
|
| 226 | 226 |
|
| 227 | 227 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 228 | 228 |
st->codec->codec_id = CODEC_ID_AC3; |
| ... | ... |
@@ -238,7 +238,7 @@ static int shorten_read_header(AVFormatContext *s, |
| 238 | 238 |
|
| 239 | 239 |
st = av_new_stream(s, 0); |
| 240 | 240 |
if (!st) |
| 241 |
- return AVERROR_NOMEM; |
|
| 241 |
+ return AVERROR(ENOMEM); |
|
| 242 | 242 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 243 | 243 |
st->codec->codec_id = CODEC_ID_SHORTEN; |
| 244 | 244 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
| ... | ... |
@@ -254,7 +254,7 @@ static int flac_read_header(AVFormatContext *s, |
| 254 | 254 |
|
| 255 | 255 |
st = av_new_stream(s, 0); |
| 256 | 256 |
if (!st) |
| 257 |
- return AVERROR_NOMEM; |
|
| 257 |
+ return AVERROR(ENOMEM); |
|
| 258 | 258 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 259 | 259 |
st->codec->codec_id = CODEC_ID_FLAC; |
| 260 | 260 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
| ... | ... |
@@ -270,7 +270,7 @@ static int dts_read_header(AVFormatContext *s, |
| 270 | 270 |
|
| 271 | 271 |
st = av_new_stream(s, 0); |
| 272 | 272 |
if (!st) |
| 273 |
- return AVERROR_NOMEM; |
|
| 273 |
+ return AVERROR(ENOMEM); |
|
| 274 | 274 |
|
| 275 | 275 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 276 | 276 |
st->codec->codec_id = CODEC_ID_DTS; |
| ... | ... |
@@ -287,7 +287,7 @@ static int aac_read_header(AVFormatContext *s, |
| 287 | 287 |
|
| 288 | 288 |
st = av_new_stream(s, 0); |
| 289 | 289 |
if (!st) |
| 290 |
- return AVERROR_NOMEM; |
|
| 290 |
+ return AVERROR(ENOMEM); |
|
| 291 | 291 |
|
| 292 | 292 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 293 | 293 |
st->codec->codec_id = CODEC_ID_AAC; |
| ... | ... |
@@ -304,7 +304,7 @@ static int video_read_header(AVFormatContext *s, |
| 304 | 304 |
|
| 305 | 305 |
st = av_new_stream(s, 0); |
| 306 | 306 |
if (!st) |
| 307 |
- return AVERROR_NOMEM; |
|
| 307 |
+ return AVERROR(ENOMEM); |
|
| 308 | 308 |
|
| 309 | 309 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| 310 | 310 |
st->codec->codec_id = s->iformat->value; |
| ... | ... |
@@ -1044,7 +1044,7 @@ static int rtsp_read_header(AVFormatContext *s, |
| 1044 | 1044 |
rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); |
| 1045 | 1045 |
|
| 1046 | 1046 |
if (!rtsp_st->rtp_ctx) {
|
| 1047 |
- err = AVERROR_NOMEM; |
|
| 1047 |
+ err = AVERROR(ENOMEM); |
|
| 1048 | 1048 |
goto fail; |
| 1049 | 1049 |
} else {
|
| 1050 | 1050 |
if(rtsp_st->dynamic_handler) {
|
| ... | ... |
@@ -1384,7 +1384,7 @@ static int sdp_read_header(AVFormatContext *s, |
| 1384 | 1384 |
s->ctx_flags |= AVFMTCTX_NOHEADER; |
| 1385 | 1385 |
rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); |
| 1386 | 1386 |
if (!rtsp_st->rtp_ctx) {
|
| 1387 |
- err = AVERROR_NOMEM; |
|
| 1387 |
+ err = AVERROR(ENOMEM); |
|
| 1388 | 1388 |
goto fail; |
| 1389 | 1389 |
} else {
|
| 1390 | 1390 |
if(rtsp_st->dynamic_handler) {
|
| ... | ... |
@@ -130,7 +130,7 @@ static int film_read_header(AVFormatContext *s, |
| 130 | 130 |
if (film->video_type) {
|
| 131 | 131 |
st = av_new_stream(s, 0); |
| 132 | 132 |
if (!st) |
| 133 |
- return AVERROR_NOMEM; |
|
| 133 |
+ return AVERROR(ENOMEM); |
|
| 134 | 134 |
film->video_stream_index = st->index; |
| 135 | 135 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| 136 | 136 |
st->codec->codec_id = film->video_type; |
| ... | ... |
@@ -142,7 +142,7 @@ static int film_read_header(AVFormatContext *s, |
| 142 | 142 |
if (film->audio_type) {
|
| 143 | 143 |
st = av_new_stream(s, 0); |
| 144 | 144 |
if (!st) |
| 145 |
- return AVERROR_NOMEM; |
|
| 145 |
+ return AVERROR(ENOMEM); |
|
| 146 | 146 |
film->audio_stream_index = st->index; |
| 147 | 147 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 148 | 148 |
st->codec->codec_id = film->audio_type; |
| ... | ... |
@@ -223,14 +223,14 @@ static int film_read_packet(AVFormatContext *s, |
| 223 | 223 |
(film->video_type == CODEC_ID_CINEPAK)) {
|
| 224 | 224 |
pkt->pos= url_ftell(pb); |
| 225 | 225 |
if (av_new_packet(pkt, sample->sample_size)) |
| 226 |
- return AVERROR_NOMEM; |
|
| 226 |
+ return AVERROR(ENOMEM); |
|
| 227 | 227 |
get_buffer(pb, pkt->data, sample->sample_size); |
| 228 | 228 |
} else if ((sample->stream == film->audio_stream_index) && |
| 229 | 229 |
(film->audio_channels == 2)) {
|
| 230 | 230 |
/* stereo PCM needs to be interleaved */ |
| 231 | 231 |
|
| 232 | 232 |
if (av_new_packet(pkt, sample->sample_size)) |
| 233 |
- return AVERROR_NOMEM; |
|
| 233 |
+ return AVERROR(ENOMEM); |
|
| 234 | 234 |
|
| 235 | 235 |
/* make sure the interleave buffer is large enough */ |
| 236 | 236 |
if (sample->sample_size > film->stereo_buffer_size) {
|
| ... | ... |
@@ -94,7 +94,7 @@ static int vmd_read_header(AVFormatContext *s, |
| 94 | 94 |
/* start up the decoders */ |
| 95 | 95 |
vst = av_new_stream(s, 0); |
| 96 | 96 |
if (!vst) |
| 97 |
- return AVERROR_NOMEM; |
|
| 97 |
+ return AVERROR(ENOMEM); |
|
| 98 | 98 |
av_set_pts_info(vst, 33, 1, 10); |
| 99 | 99 |
vmd->video_stream_index = vst->index; |
| 100 | 100 |
vst->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -111,7 +111,7 @@ static int vmd_read_header(AVFormatContext *s, |
| 111 | 111 |
if (vmd->sample_rate) {
|
| 112 | 112 |
st = av_new_stream(s, 0); |
| 113 | 113 |
if (!st) |
| 114 |
- return AVERROR_NOMEM; |
|
| 114 |
+ return AVERROR(ENOMEM); |
|
| 115 | 115 |
vmd->audio_stream_index = st->index; |
| 116 | 116 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 117 | 117 |
st->codec->codec_id = CODEC_ID_VMDAUDIO; |
| ... | ... |
@@ -155,7 +155,7 @@ static int vmd_read_header(AVFormatContext *s, |
| 155 | 155 |
if (!raw_frame_table || !vmd->frame_table) {
|
| 156 | 156 |
av_free(raw_frame_table); |
| 157 | 157 |
av_free(vmd->frame_table); |
| 158 |
- return AVERROR_NOMEM; |
|
| 158 |
+ return AVERROR(ENOMEM); |
|
| 159 | 159 |
} |
| 160 | 160 |
if (get_buffer(pb, raw_frame_table, raw_frame_table_size) != |
| 161 | 161 |
raw_frame_table_size) {
|
| ... | ... |
@@ -257,7 +257,7 @@ static int vmd_read_packet(AVFormatContext *s, |
| 257 | 257 |
url_fseek(pb, frame->frame_offset, SEEK_SET); |
| 258 | 258 |
|
| 259 | 259 |
if (av_new_packet(pkt, frame->frame_size + BYTES_PER_FRAME_RECORD)) |
| 260 |
- return AVERROR_NOMEM; |
|
| 260 |
+ return AVERROR(ENOMEM); |
|
| 261 | 261 |
pkt->pos= url_ftell(pb); |
| 262 | 262 |
memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD); |
| 263 | 263 |
ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD, |
| ... | ... |
@@ -290,7 +290,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 290 | 290 |
flags >>= 1; |
| 291 | 291 |
} |
| 292 | 292 |
if (av_new_packet(pkt, frame_size + 768)) |
| 293 |
- return AVERROR_NOMEM; |
|
| 293 |
+ return AVERROR(ENOMEM); |
|
| 294 | 294 |
if(smk->frm_size[smk->cur_frame] & 1) |
| 295 | 295 |
palchange |= 2; |
| 296 | 296 |
pkt->data[0] = palchange; |
| ... | ... |
@@ -304,7 +304,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 304 | 304 |
smk->nextpos = url_ftell(&s->pb); |
| 305 | 305 |
} else {
|
| 306 | 306 |
if (av_new_packet(pkt, smk->buf_sizes[smk->curstream])) |
| 307 |
- return AVERROR_NOMEM; |
|
| 307 |
+ return AVERROR(ENOMEM); |
|
| 308 | 308 |
memcpy(pkt->data, smk->bufs[smk->curstream], smk->buf_sizes[smk->curstream]); |
| 309 | 309 |
pkt->size = smk->buf_sizes[smk->curstream]; |
| 310 | 310 |
pkt->stream_index = smk->stream_id[smk->curstream]; |
| ... | ... |
@@ -96,7 +96,7 @@ static int thp_read_header(AVFormatContext *s, |
| 96 | 96 |
/* Video component. */ |
| 97 | 97 |
st = av_new_stream(s, 0); |
| 98 | 98 |
if (!st) |
| 99 |
- return AVERROR_NOMEM; |
|
| 99 |
+ return AVERROR(ENOMEM); |
|
| 100 | 100 |
|
| 101 | 101 |
/* The denominator and numerator are switched because 1/fps |
| 102 | 102 |
is required. */ |
| ... | ... |
@@ -119,7 +119,7 @@ static int thp_read_header(AVFormatContext *s, |
| 119 | 119 |
/* Audio component. */ |
| 120 | 120 |
st = av_new_stream(s, 0); |
| 121 | 121 |
if (!st) |
| 122 |
- return AVERROR_NOMEM; |
|
| 122 |
+ return AVERROR(ENOMEM); |
|
| 123 | 123 |
|
| 124 | 124 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 125 | 125 |
st->codec->codec_id = CODEC_ID_ADPCM_THP; |
| ... | ... |
@@ -95,7 +95,7 @@ static int seq_init_frame_buffers(SeqDemuxContext *seq, ByteIOContext *pb) |
| 95 | 95 |
seq_buffer->data_size = sz; |
| 96 | 96 |
seq_buffer->data = av_malloc(sz); |
| 97 | 97 |
if (!seq_buffer->data) |
| 98 |
- return AVERROR_NOMEM; |
|
| 98 |
+ return AVERROR(ENOMEM); |
|
| 99 | 99 |
} |
| 100 | 100 |
} |
| 101 | 101 |
seq->frame_buffers_count = i; |
| ... | ... |
@@ -208,7 +208,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 208 | 208 |
/* initialize the video decoder stream */ |
| 209 | 209 |
st = av_new_stream(s, 0); |
| 210 | 210 |
if (!st) |
| 211 |
- return AVERROR_NOMEM; |
|
| 211 |
+ return AVERROR(ENOMEM); |
|
| 212 | 212 |
|
| 213 | 213 |
av_set_pts_info(st, 32, 1, SEQ_FRAME_RATE); |
| 214 | 214 |
seq->video_stream_index = st->index; |
| ... | ... |
@@ -221,7 +221,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 221 | 221 |
/* initialize the audio decoder stream */ |
| 222 | 222 |
st = av_new_stream(s, 0); |
| 223 | 223 |
if (!st) |
| 224 |
- return AVERROR_NOMEM; |
|
| 224 |
+ return AVERROR(ENOMEM); |
|
| 225 | 225 |
|
| 226 | 226 |
av_set_pts_info(st, 32, 1, SEQ_SAMPLE_RATE); |
| 227 | 227 |
seq->audio_stream_index = st->index; |
| ... | ... |
@@ -251,7 +251,7 @@ static int seq_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 251 | 251 |
/* video packet */ |
| 252 | 252 |
if (seq->current_pal_data_size + seq->current_video_data_size != 0) {
|
| 253 | 253 |
if (av_new_packet(pkt, 1 + seq->current_pal_data_size + seq->current_video_data_size)) |
| 254 |
- return AVERROR_NOMEM; |
|
| 254 |
+ return AVERROR(ENOMEM); |
|
| 255 | 255 |
|
| 256 | 256 |
pkt->data[0] = 0; |
| 257 | 257 |
if (seq->current_pal_data_size != 0) {
|
| ... | ... |
@@ -41,7 +41,7 @@ static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) {
|
| 41 | 41 |
|
| 42 | 42 |
st = av_new_stream(s, 0); |
| 43 | 43 |
if (!st) |
| 44 |
- return AVERROR_NOMEM; |
|
| 44 |
+ return AVERROR(ENOMEM); |
|
| 45 | 45 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| 46 | 46 |
st->codec->codec_id = CODEC_ID_TXD; |
| 47 | 47 |
st->codec->time_base.den = 5; |
| ... | ... |
@@ -195,10 +195,10 @@ int av_new_packet(AVPacket *pkt, int size) |
| 195 | 195 |
{
|
| 196 | 196 |
uint8_t *data; |
| 197 | 197 |
if((unsigned)size > (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) |
| 198 |
- return AVERROR_NOMEM; |
|
| 198 |
+ return AVERROR(ENOMEM); |
|
| 199 | 199 |
data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); |
| 200 | 200 |
if (!data) |
| 201 |
- return AVERROR_NOMEM; |
|
| 201 |
+ return AVERROR(ENOMEM); |
|
| 202 | 202 |
memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); |
| 203 | 203 |
|
| 204 | 204 |
av_init_packet(pkt); |
| ... | ... |
@@ -233,10 +233,10 @@ int av_dup_packet(AVPacket *pkt) |
| 233 | 233 |
/* we duplicate the packet and don't forget to put the padding |
| 234 | 234 |
again */ |
| 235 | 235 |
if((unsigned)pkt->size > (unsigned)pkt->size + FF_INPUT_BUFFER_PADDING_SIZE) |
| 236 |
- return AVERROR_NOMEM; |
|
| 236 |
+ return AVERROR(ENOMEM); |
|
| 237 | 237 |
data = av_malloc(pkt->size + FF_INPUT_BUFFER_PADDING_SIZE); |
| 238 | 238 |
if (!data) {
|
| 239 |
- return AVERROR_NOMEM; |
|
| 239 |
+ return AVERROR(ENOMEM); |
|
| 240 | 240 |
} |
| 241 | 241 |
memcpy(data, pkt->data, pkt->size); |
| 242 | 242 |
memset(data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); |
| ... | ... |
@@ -358,7 +358,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, |
| 358 | 358 |
else |
| 359 | 359 |
ic = *ic_ptr; |
| 360 | 360 |
if (!ic) {
|
| 361 |
- err = AVERROR_NOMEM; |
|
| 361 |
+ err = AVERROR(ENOMEM); |
|
| 362 | 362 |
goto fail; |
| 363 | 363 |
} |
| 364 | 364 |
ic->iformat = fmt; |
| ... | ... |
@@ -372,7 +372,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, |
| 372 | 372 |
if (fmt->priv_data_size > 0) {
|
| 373 | 373 |
ic->priv_data = av_mallocz(fmt->priv_data_size); |
| 374 | 374 |
if (!ic->priv_data) {
|
| 375 |
- err = AVERROR_NOMEM; |
|
| 375 |
+ err = AVERROR(ENOMEM); |
|
| 376 | 376 |
goto fail; |
| 377 | 377 |
} |
| 378 | 378 |
} else {
|
| ... | ... |
@@ -868,13 +868,13 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) |
| 868 | 868 |
|
| 869 | 869 |
/* duplicate the packet */ |
| 870 | 870 |
if (av_dup_packet(pkt) < 0) |
| 871 |
- return AVERROR_NOMEM; |
|
| 871 |
+ return AVERROR(ENOMEM); |
|
| 872 | 872 |
|
| 873 | 873 |
while(*plast_pktl) plast_pktl= &(*plast_pktl)->next; //FIXME maybe maintain pointer to the last? |
| 874 | 874 |
|
| 875 | 875 |
pktl = av_mallocz(sizeof(AVPacketList)); |
| 876 | 876 |
if (!pktl) |
| 877 |
- return AVERROR_NOMEM; |
|
| 877 |
+ return AVERROR(ENOMEM); |
|
| 878 | 878 |
|
| 879 | 879 |
/* add the packet in the buffered packet list */ |
| 880 | 880 |
*plast_pktl = pktl; |
| ... | ... |
@@ -1727,7 +1727,7 @@ int av_find_stream_info(AVFormatContext *ic) |
| 1727 | 1727 |
int codec_identified[MAX_STREAMS]={0};
|
| 1728 | 1728 |
|
| 1729 | 1729 |
duration_error = av_mallocz(MAX_STREAMS * sizeof(*duration_error)); |
| 1730 |
- if (!duration_error) return AVERROR_NOMEM; |
|
| 1730 |
+ if (!duration_error) return AVERROR(ENOMEM); |
|
| 1731 | 1731 |
|
| 1732 | 1732 |
for(i=0;i<ic->nb_streams;i++) {
|
| 1733 | 1733 |
st = ic->streams[i]; |
| ... | ... |
@@ -1807,7 +1807,7 @@ int av_find_stream_info(AVFormatContext *ic) |
| 1807 | 1807 |
|
| 1808 | 1808 |
pktl = av_mallocz(sizeof(AVPacketList)); |
| 1809 | 1809 |
if (!pktl) {
|
| 1810 |
- ret = AVERROR_NOMEM; |
|
| 1810 |
+ ret = AVERROR(ENOMEM); |
|
| 1811 | 1811 |
break; |
| 1812 | 1812 |
} |
| 1813 | 1813 |
|
| ... | ... |
@@ -1820,7 +1820,7 @@ int av_find_stream_info(AVFormatContext *ic) |
| 1820 | 1820 |
|
| 1821 | 1821 |
/* duplicate the packet */ |
| 1822 | 1822 |
if (av_dup_packet(pkt) < 0) {
|
| 1823 |
- ret = AVERROR_NOMEM; |
|
| 1823 |
+ ret = AVERROR(ENOMEM); |
|
| 1824 | 1824 |
break; |
| 1825 | 1825 |
} |
| 1826 | 1826 |
|
| ... | ... |
@@ -2088,7 +2088,7 @@ int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) |
| 2088 | 2088 |
if (s->oformat->priv_data_size > 0) {
|
| 2089 | 2089 |
s->priv_data = av_mallocz(s->oformat->priv_data_size); |
| 2090 | 2090 |
if (!s->priv_data) |
| 2091 |
- return AVERROR_NOMEM; |
|
| 2091 |
+ return AVERROR(ENOMEM); |
|
| 2092 | 2092 |
} else |
| 2093 | 2093 |
s->priv_data = NULL; |
| 2094 | 2094 |
|
| ... | ... |
@@ -2143,7 +2143,7 @@ int av_write_header(AVFormatContext *s) |
| 2143 | 2143 |
if (!s->priv_data && s->oformat->priv_data_size > 0) {
|
| 2144 | 2144 |
s->priv_data = av_mallocz(s->oformat->priv_data_size); |
| 2145 | 2145 |
if (!s->priv_data) |
| 2146 |
- return AVERROR_NOMEM; |
|
| 2146 |
+ return AVERROR(ENOMEM); |
|
| 2147 | 2147 |
} |
| 2148 | 2148 |
|
| 2149 | 2149 |
if(s->oformat->write_header){
|
| ... | ... |
@@ -52,7 +52,7 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 52 | 52 |
url_fskip(pb, header_size); |
| 53 | 53 |
st = av_new_stream(s, 0); |
| 54 | 54 |
if (!st) |
| 55 |
- return AVERROR_NOMEM; |
|
| 55 |
+ return AVERROR(ENOMEM); |
|
| 56 | 56 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 57 | 57 |
|
| 58 | 58 |
voc->remaining_size = 0; |
| ... | ... |
@@ -176,7 +176,7 @@ static int wav_read_header(AVFormatContext *s, |
| 176 | 176 |
return -1; |
| 177 | 177 |
st = av_new_stream(s, 0); |
| 178 | 178 |
if (!st) |
| 179 |
- return AVERROR_NOMEM; |
|
| 179 |
+ return AVERROR(ENOMEM); |
|
| 180 | 180 |
|
| 181 | 181 |
get_wav_header(pb, st->codec, size); |
| 182 | 182 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
| ... | ... |
@@ -238,7 +238,7 @@ static int wc3_read_header(AVFormatContext *s, |
| 238 | 238 |
/* initialize the decoder streams */ |
| 239 | 239 |
st = av_new_stream(s, 0); |
| 240 | 240 |
if (!st) |
| 241 |
- return AVERROR_NOMEM; |
|
| 241 |
+ return AVERROR(ENOMEM); |
|
| 242 | 242 |
av_set_pts_info(st, 33, 1, 90000); |
| 243 | 243 |
wc3->video_stream_index = st->index; |
| 244 | 244 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -252,7 +252,7 @@ static int wc3_read_header(AVFormatContext *s, |
| 252 | 252 |
|
| 253 | 253 |
st = av_new_stream(s, 0); |
| 254 | 254 |
if (!st) |
| 255 |
- return AVERROR_NOMEM; |
|
| 255 |
+ return AVERROR(ENOMEM); |
|
| 256 | 256 |
av_set_pts_info(st, 33, 1, 90000); |
| 257 | 257 |
wc3->audio_stream_index = st->index; |
| 258 | 258 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -138,7 +138,7 @@ static int wsaud_read_header(AVFormatContext *s, |
| 138 | 138 |
/* initialize the audio decoder stream */ |
| 139 | 139 |
st = av_new_stream(s, 0); |
| 140 | 140 |
if (!st) |
| 141 |
- return AVERROR_NOMEM; |
|
| 141 |
+ return AVERROR(ENOMEM); |
|
| 142 | 142 |
av_set_pts_info(st, 33, 1, wsaud->audio_samplerate); |
| 143 | 143 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 144 | 144 |
st->codec->codec_id = wsaud->audio_type; |
| ... | ... |
@@ -223,7 +223,7 @@ static int wsvqa_read_header(AVFormatContext *s, |
| 223 | 223 |
/* initialize the video decoder stream */ |
| 224 | 224 |
st = av_new_stream(s, 0); |
| 225 | 225 |
if (!st) |
| 226 |
- return AVERROR_NOMEM; |
|
| 226 |
+ return AVERROR(ENOMEM); |
|
| 227 | 227 |
av_set_pts_info(st, 33, 1, VQA_FRAMERATE); |
| 228 | 228 |
wsvqa->video_stream_index = st->index; |
| 229 | 229 |
st->codec->codec_type = CODEC_TYPE_VIDEO; |
| ... | ... |
@@ -249,7 +249,7 @@ static int wsvqa_read_header(AVFormatContext *s, |
| 249 | 249 |
if (AV_RL16(&header[24]) || (AV_RL16(&header[0]) == 1 && AV_RL16(&header[2]) == 1)) {
|
| 250 | 250 |
st = av_new_stream(s, 0); |
| 251 | 251 |
if (!st) |
| 252 |
- return AVERROR_NOMEM; |
|
| 252 |
+ return AVERROR(ENOMEM); |
|
| 253 | 253 |
av_set_pts_info(st, 33, 1, VQA_FRAMERATE); |
| 254 | 254 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 255 | 255 |
if (AV_RL16(&header[0]) == 1) |
| ... | ... |
@@ -177,7 +177,7 @@ static int wv_read_packet(AVFormatContext *s, |
| 177 | 177 |
} |
| 178 | 178 |
|
| 179 | 179 |
if(av_new_packet(pkt, wc->blksize + WV_EXTRA_SIZE) < 0) |
| 180 |
- return AVERROR_NOMEM; |
|
| 180 |
+ return AVERROR(ENOMEM); |
|
| 181 | 181 |
memcpy(pkt->data, wc->extra, WV_EXTRA_SIZE); |
| 182 | 182 |
ret = get_buffer(&s->pb, pkt->data + WV_EXTRA_SIZE, wc->blksize); |
| 183 | 183 |
if(ret != wc->blksize){
|