summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-16 19:02:35 +0200
committerwm4 <wm4@nowhere>2017-07-16 19:02:35 +0200
commitc1dcf74458b6453dfe5ec9096101773c7a4ceadf (patch)
tree25b8e195dbec115ec8c12d0b0e4b33e01a9f6d59 /demux
parent44391af7df57cf5e1cafda53ac998e7b55c51b92 (diff)
downloadmpv-c1dcf74458b6453dfe5ec9096101773c7a4ceadf.tar.bz2
mpv-c1dcf74458b6453dfe5ec9096101773c7a4ceadf.tar.xz
demux_disc: fix bluray subtitle language retrieval
It seems like adjusting the raw stream ID should be done only for DVD. Otherwise, getting the subtitle language for Bluray breaks. Untested. Regression since fb9a32977d6. Fixes #4611 (probably).
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_disc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/demux/demux_disc.c b/demux/demux_disc.c
index 6c88bc1adc..6ab17e69c8 100644
--- a/demux/demux_disc.c
+++ b/demux/demux_disc.c
@@ -64,10 +64,10 @@ static void reselect_streams(demuxer_t *demuxer)
}
}
-static void get_disc_lang(struct stream *stream, struct sh_stream *sh)
+static void get_disc_lang(struct stream *stream, struct sh_stream *sh, bool dvd)
{
struct stream_lang_req req = {.type = sh->type, .id = sh->demuxer_id};
- if (sh->type == STREAM_SUB)
+ if (dvd && sh->type == STREAM_SUB)
req.id = req.id & 0x1F; // mpeg ID to index
stream_control(stream, STREAM_CTRL_GET_LANG, &req);
if (req.name[0])
@@ -86,7 +86,7 @@ static void add_dvd_streams(demuxer_t *demuxer)
struct sh_stream *sh = demux_alloc_sh_stream(STREAM_SUB);
sh->demuxer_id = n + 0x20;
sh->codec->codec = "dvd_subtitle";
- get_disc_lang(stream, sh);
+ get_disc_lang(stream, sh, true);
// p->streams _must_ match with p->slave->streams, so we can't add
// it yet - it has to be done when the real stream appears, which
// could be right on start, or any time later.
@@ -154,7 +154,7 @@ static void add_streams(demuxer_t *demuxer)
sh->codec->par_h = f.p_h;
}
}
- get_disc_lang(demuxer->stream, sh);
+ get_disc_lang(demuxer->stream, sh, p->is_dvd);
demux_add_sh_stream(demuxer, sh);
}
reselect_streams(demuxer);