# HG changeset patch # User eugeni # Date 1204305952 0 # Node ID 8732f2107b567b927433613e1c2388e35bb5501f # Parent c585e2ad8ebfbf6feb82cc06f315d6101c475c7b Don't select audio stream in lavf and mkv demuxers. diff -r c585e2ad8ebf -r 8732f2107b56 libmpdemux/demux_lavf.c --- a/libmpdemux/demux_lavf.c Fri Feb 29 17:25:50 2008 +0000 +++ b/libmpdemux/demux_lavf.c Fri Feb 29 17:25:52 2008 +0000 @@ -338,8 +338,8 @@ 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 diff -r c585e2ad8ebf -r 8732f2107b56 libmpdemux/demux_mkv.c --- a/libmpdemux/demux_mkv.c Fri Feb 29 17:25:50 2008 +0000 +++ b/libmpdemux/demux_mkv.c Fri Feb 29 17:25:52 2008 +0000 @@ -2418,14 +2418,7 @@ /* 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 @@ 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;