From 13ae78d207d773f83990a0a6bb06b60f3574f7e3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 13 Dec 2014 18:37:31 +0100 Subject: dvd: add an extra chapter at position 0 This way, chapter 0 will always point to the start of the title. At least this is the intention; it's likely that DVDs as well as libdvdnav do random things that lead to random results. --- stream/stream_dvdnav.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 67436aa5e6..92252aa5a4 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -489,7 +489,7 @@ static int control(stream_t *stream, int cmd, void *arg) break; if (!part) break; - *(unsigned int *)arg = part; + *(unsigned int *)arg = part + 1; return 1; } case STREAM_CTRL_GET_CHAPTER_TIME: { @@ -503,7 +503,7 @@ static int control(stream_t *stream, int cmd, void *arg) break; if (chapter < 0 || chapter >= n) break; - *ch = parts[chapter] / 90000.0; + *ch = chapter > 0 ? parts[chapter - 1] / 90000.0 : 0; free(parts); return 1; } -- cgit v1.2.3