[libbluray-devel] Fix bd_tell_time

John Stebbins git at videolan.org
Wed Nov 23 18:17:40 CET 2011


libbluray | branch: master | John Stebbins <jstebbins.hb at gmail.com> | Wed Nov 23 09:15:36 2011 -0800| [3fca7312f8c162923524152fc32c0fbabf4092a9] | committer: John Stebbins

Fix bd_tell_time

It should return the time offset from the beginning of the title instead
of from the beginning of the current clip.

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

 src/libbluray/bluray.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 0575b37..bd90184 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1006,9 +1006,13 @@ int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
 uint64_t bd_tell_time(BLURAY *bd)
 {
     uint32_t clip_pkt = 0, out_pkt = 0, out_time = 0;
+    NAV_CLIP *clip;
 
     if (bd && bd->title) {
-        nav_packet_search(bd->title, bd->s_pos / 192, &clip_pkt, &out_pkt, &out_time);
+        clip = nav_packet_search(bd->title, bd->s_pos / 192, &clip_pkt, &out_pkt, &out_time);
+        if (clip) {
+            out_time += clip->start_time;
+        }
     }
 
     return ((uint64_t)out_time) * 2;



More information about the libbluray-devel mailing list