Mercurial > libavformat.hg
changeset 3423:613aff547655 libavformat
Ensure the first audio stream is selected as the default stream
when no video stream is present.
author | aurel |
---|---|
date | Tue, 03 Jun 2008 15:19:43 +0000 |
parents | 6ff296d8b284 |
children | 7a0230981402 |
files | utils.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/utils.c Tue Jun 03 15:14:21 2008 +0000 +++ b/utils.c Tue Jun 03 15:19:43 2008 +0000 @@ -1004,6 +1004,7 @@ int av_find_default_stream_index(AVFormatContext *s) { + int first_audio_index = -1; int i; AVStream *st; @@ -1014,8 +1015,10 @@ 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; } /**