From a7b91626cf04139b3a42db048fe5b5aea96e141a Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 8 Nov 2010 02:38:51 +0200 Subject: core: use correct demuxer with -audiofile / -subfile Various code referred to "mpctx->demuxer" where it should really have referred to the one used for audio/subtitles in case those differ. Fix by using "mpctx->d_audio->demuxer" etc instead. Disable the copying of streams in demux_demuxers; that was a partial workaround for things referring to the main demuxer (and it wasn't enough anyway). This fixes, among other things, switching audio tracks within the file specified by -audiofile. --- mplayer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index d6007a58c4..3423813deb 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1958,9 +1958,10 @@ static int select_subtitle(MPContext *mpctx) if (!found && opts->sub_id == -1) { // finally select subs by language and container hints if (opts->sub_id == -1 && opts->sub_lang) - opts->sub_id = demuxer_sub_track_by_lang(mpctx->demuxer, opts->sub_lang); + opts->sub_id = demuxer_sub_track_by_lang(mpctx->d_sub->demuxer, + opts->sub_lang); if (opts->sub_id == -1) - opts->sub_id = demuxer_default_sub_track(mpctx->demuxer); + opts->sub_id = demuxer_default_sub_track(mpctx->d_sub->demuxer); if (opts->sub_id >= 0) { id = opts->sub_id; found = mp_property_do("sub_demux", M_PROPERTY_SET, &id, mpctx) == M_PROPERTY_OK; @@ -3880,7 +3881,7 @@ if (ts_prog) { select_audio(mpctx->sources[i].demuxer, opts->audio_id, opts->audio_lang); else - select_audio(mpctx->demuxer, opts->audio_id, opts->audio_lang); + select_audio(mpctx->d_audio->demuxer, opts->audio_id, opts->audio_lang); // DUMP STREAMS: if((stream_dump_type)&&(stream_dump_type<4)){ -- cgit v1.2.3