mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 03:52:22 +02:00
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 fb9a32977d
.
Fixes #4611 (probably).
This commit is contained in:
parent
44391af7df
commit
c1dcf74458
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user