From ba591ebf6d3c9ef6a4341195d8718b425e54055e Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Mon, 4 Apr 2016 14:08:34 -0600 Subject: 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. --- .../libbluray/A01-fix-current-chapter-lookup.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 contrib/libbluray/A01-fix-current-chapter-lookup.patch 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; -- cgit v1.2.3