#define MAX_FILES 100
#define MAX_STREAMS 1024 /* arbitrary sanity check value */
-
static const char *last_asked_format = NULL;
static double *ts_scale;
static int nb_ts_scale;
ret = avcodec_decode_audio3(ist->st->codec, samples, &decoded_data_size,
&avpkt);
if (ret < 0)
- goto fail_decode;
+ return ret;
avpkt.data += ret;
avpkt.size -= ret;
data_size = ret;
&picture, &got_output, &avpkt);
quality = same_quality ? picture.quality : 0;
if (ret < 0)
- goto fail_decode;
+ return ret;
if (!got_output) {
/* no picture yet */
goto discard_packet;
ret = avcodec_decode_subtitle2(ist->st->codec,
&subtitle, &got_output, &avpkt);
if (ret < 0)
- goto fail_decode;
+ return ret;
if (!got_output) {
goto discard_packet;
}
avpkt.size = 0;
break;
default:
- goto fail_decode;
+ return -1;
}
} else {
switch(ist->st->codec->codec_type) {
}
return 0;
- fail_decode:
- return -1;
}
static void print_sdp(AVFormatContext **avc, int n)
p++;
scale= strtod(p, &p);
- if(stream >= MAX_STREAMS)
- ffmpeg_exit(1);
-
ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
ts_scale[stream] = scale;
return 0;
ffmpeg_exit(1);
}
*p++ = '\0';
- idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
+ idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX);
streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
return 0;