summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-13 18:37:31 +0100
committerwm4 <wm4@nowhere>2014-12-13 20:25:56 +0100
commit13ae78d207d773f83990a0a6bb06b60f3574f7e3 (patch)
treea8b4d0df20d4d73675b93771d4dfed55378298f4 /stream
parent8c927376a175e641d5b4c04d977ad0bc7a7bf462 (diff)
downloadmpv-13ae78d207d773f83990a0a6bb06b60f3574f7e3.tar.bz2
mpv-13ae78d207d773f83990a0a6bb06b60f3574f7e3.tar.xz
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.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvdnav.c4
1 files changed, 2 insertions, 2 deletions
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;
}