From 84ad31ff180fa089cd6bfd93c246336a16036455 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 18 Jun 2011 11:43:24 +0200 Subject: lavf: replace av_new_stream->avformat_new_stream part II. Manual replacements are done in this commit. In many cases, the id is some constant made up number (e.g. 0 for video and 1 for audio), which is then not used in the demuxer for anything. Those ids are removed. --- avconv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'avconv.c') diff --git a/avconv.c b/avconv.c index 3c68ffc10b..8fc6fd1425 100644 --- a/avconv.c +++ b/avconv.c @@ -3016,7 +3016,7 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type) { OutputStream *ost; - AVStream *st = av_new_stream(oc, oc->nb_streams < o->nb_streamid_map ? o->streamid_map[oc->nb_streams] : 0); + AVStream *st = avformat_new_stream(oc, NULL); int idx = oc->nb_streams - 1, ret = 0; int64_t max_frames = INT64_MAX; char *bsf = NULL, *next, *codec_tag = NULL; @@ -3030,6 +3030,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e exit_program(1); } + if (oc->nb_streams - 1 < o->nb_streamid_map) + st->id = o->streamid_map[oc->nb_streams - 1]; + output_streams = grow_array(output_streams, sizeof(*output_streams), &nb_output_streams, nb_output_streams + 1); ost = &output_streams[nb_output_streams - 1]; -- cgit v1.2.3