Don't select audio stream in lavf and mkv demuxers.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26123 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2008-02-29 17:25:52 +00:00
parent 22465e56cc
commit 439cfd5d9e
2 changed files with 3 additions and 13 deletions

View File

@ -338,8 +338,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
if (st->language)
sh_audio->lang = strdup(st->language);
if(mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf, MSGL_V);
if((audio_lang && st->language[0] && !strncmp(audio_lang, st->language, 3))
|| (demuxer->audio->id == i || demuxer->audio->id == -1)) {
// select the first audio stream
if (!demuxer->audio->sh) {
demuxer->audio->id = i;
demuxer->audio->sh= demuxer->a_streams[i];
} else

View File

@ -2418,14 +2418,7 @@ demux_mkv_open (demuxer_t *demuxer)
/* select audio track */
track = NULL;
if (demuxer->audio->id == -1) /* automatically select an audio track */
{
/* check if the user specified an audio language */
if (audio_lang != NULL)
track = demux_mkv_find_track_by_language(mkv_d, audio_lang,
MATROSKA_TRACK_AUDIO);
if (track == NULL)
/* no audio language specified, or language not found */
/* search for an audio track that has the 'default' flag set */
for (i=0; i < mkv_d->num_tracks; i++)
if (mkv_d->tracks[i]->type == MATROSKA_TRACK_AUDIO
@ -2444,10 +2437,7 @@ demux_mkv_open (demuxer_t *demuxer)
track = mkv_d->tracks[i];
break;
}
}
else if (demuxer->audio->id != -2) /* -2 = no audio at all */
track = demux_mkv_find_track_by_num (mkv_d, demuxer->audio->id,
MATROSKA_TRACK_AUDIO);
if (track && demuxer->a_streams[track->tnum])
{
demuxer->audio->id = track->tnum;