core: do proper audio track selection for -audiofile demuxer

The select_audio() call was done on the main demuxer, not -audiofile
one (the "if (mpctx->num_sources)" test in the previous code was
always true). Call it on the -audiofile demuxer instead. The
-audiofile stuff still needs a proper cleanup later though.
This commit is contained in:
Uoti Urpala 2011-04-02 22:26:03 +03:00
parent adc941419d
commit 1bda89eaba
1 changed files with 3 additions and 6 deletions

View File

@ -4608,12 +4608,9 @@ if (ts_prog) {
mp_property_do("switch_program", M_PROPERTY_SET, &tmp, mpctx); mp_property_do("switch_program", M_PROPERTY_SET, &tmp, mpctx);
} }
// select audio stream // select audio stream
if (mpctx->num_sources) for (int i = 0; i < mpctx->num_sources; i++)
for (int i = 0; i < mpctx->num_sources; i++) select_audio(mpctx->sources[i].demuxer->audio->demuxer, opts->audio_id,
select_audio(mpctx->sources[i].demuxer, opts->audio_id, opts->audio_lang);
opts->audio_lang);
else
select_audio(mpctx->d_audio->demuxer, opts->audio_id, opts->audio_lang);
// DUMP STREAMS: // DUMP STREAMS:
if((stream_dump_type)&&(stream_dump_type<4)){ if((stream_dump_type)&&(stream_dump_type<4)){