[libbluray-devel] commit: Fix chapter lookup problems (john )

git at videolan.org git at videolan.org
Fri Sep 3 06:16:05 CEST 2010


libbluray | branch: master | john <john at anonymous.org> | Thu Sep  2 21:15:07 2010 -0700| [fd8ba1926b85853c0cdc596a980211d1e054402a] | committer: john 

Fix chapter lookup problems

Both looking up the current chapter and looking up the
position of a chapter were broken.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=fd8ba1926b85853c0cdc596a980211d1e054402a
---

 src/libbluray/bdnav/navigation.c |    7 +++++++
 src/libbluray/bluray.c           |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
index adca357..454aba7 100644
--- a/src/libbluray/bdnav/navigation.c
+++ b/src/libbluray/bdnav/navigation.c
@@ -542,6 +542,13 @@ uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t pkt)
     title = clip->title;
     for (ii = 0; ii < title->chap_list.count; ii++) {
         mark = &title->chap_list.mark[ii];
+        if (mark->clip_ref > clip->ref)
+        {
+            if (ii)
+                return ii-1;
+            else
+                return 0;
+        }
         if (mark->clip_ref == clip->ref && mark->clip_pkt <= pkt) {
             if ( ii == title->chap_list.count - 1 ) {
                 return ii;
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index da22cc8..f0dd9a6 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -102,7 +102,7 @@ struct bluray {
     unsigned       request_angle;
 
     /* chapter tracking */
-    uint32_t       next_chapter_start;
+    uint64_t       next_chapter_start;
 
     /* aacs */
 #ifdef DLOPEN_CRYPTO_LIBS



More information about the libbluray-devel mailing list