[libbluray-devel] Always use _set_scr() for application-provided timetamps

hpi1 git at videolan.org
Thu Apr 14 09:44:04 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Apr 14 10:19:54 2016 +0300| [b633ab325254901133528c44950fcc4290464bc4] | committer: hpi1

Always use _set_scr() for application-provided timetamps

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

 src/libbluray/bluray.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 9d15af1..9d43450 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2831,6 +2831,14 @@ void bd_stop_bdj(BLURAY *bd)
  * Navigation mode interface
  */
 
+static void _set_scr(BLURAY *bd, int64_t pts)
+{
+    if (pts >= 0) {
+        uint32_t tick = (uint32_t)(((uint64_t)pts) >> 1);
+        bd_psr_write(bd->regs, PSR_TIME, tick);
+    }
+}
+
 static void _process_psr_restore_event(BLURAY *bd, BD_PSR_EVENT *ev)
 {
     /* PSR restore events are handled internally.
@@ -3234,9 +3242,7 @@ int bd_play_title(BLURAY *bd, unsigned title)
 
 static int _try_menu_call(BLURAY *bd, int64_t pts)
 {
-    if (pts >= 0) {
-        bd_psr_write(bd->regs, PSR_TIME, (uint32_t)(((uint64_t)pts) >> 1));
-    }
+    _set_scr(bd, pts);
 
     if (bd->title_type == title_undef) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_menu_call(): bd_play() not called\n");
@@ -3465,13 +3471,6 @@ int bd_get_event(BLURAY *bd, BD_EVENT *event)
  * user interaction
  */
 
-static void _set_scr(BLURAY *bd, int64_t pts)
-{
-    if (pts >= 0) {
-        bd_psr_write(bd->regs, PSR_TIME, (uint32_t)(((uint64_t)pts) >> 1));
-    }
-}
-
 void bd_set_scr(BLURAY *bd, int64_t pts)
 {
     bd_mutex_lock(&bd->mutex);



More information about the libbluray-devel mailing list