From: Michael Niedermayer Date: Fri, 25 Oct 2013 00:08:35 +0000 (+0200) Subject: ffmpeg: make stream default if its the only of its kind and no source can be unambigo... X-Git-Tag: n2.1~88 X-Git-Url: https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=a443b9732f75dbf9018214c5706e01534bb37f28 ffmpeg: make stream default if its the only of its kind and no source can be unambigously assigned to it Fixes Ticket2969 Signed-off-by: Michael Niedermayer --- diff --git a/ffmpeg.c b/ffmpeg.c index 31482679f8..001e5c15da 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2160,6 +2160,15 @@ static int transcode_init(void) ost->st->disposition = ist->st->disposition; codec->bits_per_raw_sample = icodec->bits_per_raw_sample; codec->chroma_sample_location = icodec->chroma_sample_location; + } else { + for (j=0; jnb_streams; j++) { + AVStream *st = oc->streams[j]; + if (st != ost->st && st->codec->codec_type == codec->codec_type) + break; + } + if (j == oc->nb_streams) + if (codec->codec_type == AVMEDIA_TYPE_AUDIO || codec->codec_type == AVMEDIA_TYPE_VIDEO) + ost->st->disposition = AV_DISPOSITION_DEFAULT; } if (ost->stream_copy) {