Commit 8ef9c540 authored by aurel's avatar aurel

Ensure the first audio stream is selected as the default stream

when no video stream is present.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13648 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e2a226d3
......@@ -1004,6 +1004,7 @@ static void flush_packet_queue(AVFormatContext *s)
int av_find_default_stream_index(AVFormatContext *s)
{
int first_audio_index = -1;
int i;
AVStream *st;
......@@ -1014,8 +1015,10 @@ int av_find_default_stream_index(AVFormatContext *s)
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
return i;
}
if (first_audio_index < 0 && st->codec->codec_type == CODEC_TYPE_AUDIO)
first_audio_index = i;
}
return 0;
return first_audio_index >= 0 ? first_audio_index : 0;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment