summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqrwyeui <qrwyeui@mailinator.com>2017-03-15 01:34:55 +0000
committerwm4 <wm4@nowhere>2017-03-15 02:54:18 +0100
commit50abbf76e680764351531f1838643826c137ec8b (patch)
tree5e712e0b6d17b7b5da5abadf62aa1a477def0a12
parent9a23a14cec99adf734a46d3f533b1f200328a214 (diff)
downloadmpv-50abbf76e680764351531f1838643826c137ec8b.tar.bz2
mpv-50abbf76e680764351531f1838643826c137ec8b.tar.xz
stream_dvd: fix subs/audio detection on DVDs containing multi-PGC titles
On some DVDs, title number is not necessarily the same as the (first) PGC number. (Most often they are equal, since there's usually exactly one PGC per title, which is likely why this issue wasn't noticed before.) When searching for audio/subtitle metadata, we want to look at the actual PGC we're about to play. See discussion in issue #4235. Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--stream/stream_dvd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index fe5796d30d..4fe3e3e7a3 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -781,7 +781,9 @@ static int open_s_internal(stream_t *stream)
d->vts_file=vts_file;
d->cur_title = d->dvd_title;
- pgc = vts_file->vts_pgcit ? vts_file->vts_pgcit->pgci_srp[ttn].pgc : NULL;
+ pgc_id = vts_file->vts_ptt_srpt->title[ttn].ptt[0].pgcn; // local
+ pgn = vts_file->vts_ptt_srpt->title[ttn].ptt[0].pgn; // local
+ pgc = vts_file->vts_pgcit ? vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc : NULL;
/**
* Check number of audio channels and types
*/
@@ -879,8 +881,6 @@ static int open_s_internal(stream_t *stream)
* Determine which program chain we want to watch. This is based on the
* chapter number.
*/
- pgc_id = vts_file->vts_ptt_srpt->title[ttn].ptt[0].pgcn; // local
- pgn = vts_file->vts_ptt_srpt->title[ttn].ptt[0].pgn; // local
d->cur_pgc_idx = pgc_id-1;
d->cur_pgc = vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc;
d->cur_cell = d->cur_pgc->program_map[pgn-1] - 1; // start playback here