From c1dcf74458b6453dfe5ec9096101773c7a4ceadf Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 16 Jul 2017 19:02:35 +0200 Subject: 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). --- demux/demux_disc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'demux') 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); -- cgit v1.2.3