diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-25 02:08:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-25 02:08:35 +0200 |
commit | a443b9732f75dbf9018214c5706e01534bb37f28 (patch) | |
tree | 6bf595a34cb648216ddc4ead5fc24d0fd502a5b5 /ffmpeg.c | |
parent | 4fb14f84926ebcf88222e2251f4b8141d6bec465 (diff) | |
download | ffmpeg-a443b9732f75dbf9018214c5706e01534bb37f28.tar.gz |
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 <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; j<oc->nb_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) { |