summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-08 02:38:51 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-08 18:05:12 +0200
commita7b91626cf04139b3a42db048fe5b5aea96e141a (patch)
tree66c48a2ffe943c260ca62e3f9b39481fda97cac0 /mplayer.c
parent82cd2f7aecef6594f1aea15251b547365bebb183 (diff)
downloadmpv-a7b91626cf04139b3a42db048fe5b5aea96e141a.tar.bz2
mpv-a7b91626cf04139b3a42db048fe5b5aea96e141a.tar.xz
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.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c7
1 files changed, 4 insertions, 3 deletions
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)){