summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-13 18:40:44 +0100
committerwm4 <wm4@nowhere>2014-12-13 20:25:56 +0100
commit8b7418db9730d2e201f49f741756bb0ffec90f37 (patch)
tree657cb29b512e8298713a155586139df1225aa69b /stream
parent13ae78d207d773f83990a0a6bb06b60f3574f7e3 (diff)
downloadmpv-8b7418db9730d2e201f49f741756bb0ffec90f37.tar.bz2
mpv-8b7418db9730d2e201f49f741756bb0ffec90f37.tar.xz
dvd: drop last chapter
Apparently, libdvdnav always reports a last chapter that points to the exact end of the title. This is useless for us. Again, same possible caveats as with the previous commit.
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 92252aa5a4..be116e65ba 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 + 1;
+ *(unsigned int *)arg = part;
return 1;
}
case STREAM_CTRL_GET_CHAPTER_TIME: {
@@ -501,7 +501,7 @@ static int control(stream_t *stream, int cmd, void *arg)
int n = dvdnav_describe_title_chapters(dvdnav, tit, &parts, &duration);
if (!parts)
break;
- if (chapter < 0 || chapter >= n)
+ if (chapter < 0 || chapter + 1 >= n)
break;
*ch = chapter > 0 ? parts[chapter - 1] / 90000.0 : 0;
free(parts);