summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-04-04 14:08:34 -0600
committerJohn Stebbins <[email protected]>2016-04-04 14:08:34 -0600
commitba591ebf6d3c9ef6a4341195d8718b425e54055e (patch)
treea9e2a628134ec4d11bbf92f15de7541a869ac850
parent82c09171bc5bfc447355cf5a743908a6a139c360 (diff)
libbluray: fix chapter lookup
when there are multiple clips in the title, chapter lookup could fail if the current play position is before the first chapter mark in a clip.
-rw-r--r--contrib/libbluray/A01-fix-current-chapter-lookup.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/libbluray/A01-fix-current-chapter-lookup.patch b/contrib/libbluray/A01-fix-current-chapter-lookup.patch
new file mode 100644
index 000000000..313c1cd22
--- /dev/null
+++ b/contrib/libbluray/A01-fix-current-chapter-lookup.patch
@@ -0,0 +1,20 @@
+diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
+index 60eccbb..4752196 100644
+--- a/src/libbluray/bdnav/navigation.c
++++ b/src/libbluray/bdnav/navigation.c
+@@ -754,6 +754,15 @@ uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t clip_pkt)
+ else
+ return 0;
+ }
++ if (mark->clip_ref < clip->ref) {
++ if ( ii == title->chap_list.count - 1 ) {
++ return ii;
++ }
++ mark = &title->chap_list.mark[ii+1];
++ if (mark->clip_ref == clip->ref && mark->clip_pkt > clip_pkt) {
++ return ii;
++ }
++ }
+ if (mark->clip_ref == clip->ref && mark->clip_pkt <= clip_pkt) {
+ if ( ii == title->chap_list.count - 1 ) {
+ return ii;