[libbluray-devel] Forward title change events to libbdplus

npzacs git at videolan.org
Sun Dec 1 17:58:22 CET 2013


libbluray | branch: master | npzacs <npzacs at gmail.com> | Sun Dec  1 18:54:07 2013 +0200| [0c6f00cfbe6582f8c57db7f3dc1fdb7255c9c8ae] | committer: npzacs

Forward title change events to libbdplus

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

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

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 7012cd9..f5580fb 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -871,9 +871,6 @@ static int _libbdplus_init(BLURAY *bd)
     /* connect registers */
     libbdplus_psr(bd->libbdplus, (void*)bd->regs, (void*)bd_psr_read, (void*)bd_psr_write);
 
-    /* start VM */
-    libbdplus_start(bd->libbdplus);
-
     bd->disc_info.bdplus_handled = 1;
     return 1;
 }
@@ -2132,6 +2129,11 @@ uint32_t bd_get_titles(BLURAY *bd, uint8_t flags, uint32_t min_title_length)
         return 0;
     }
 
+    /* start BD+. No real title info will be passed to BD+ VM ... */
+    if (bd->libbdplus) {
+        libbdplus_event(bd->libbdplus, 0xffffffff, bd->index->num_titles, 0);
+    }
+
     return bd->title_list->count;
 }
 
@@ -2498,6 +2500,7 @@ static void _process_psr_write_event(BLURAY *bd, BD_PSR_EVENT *ev)
             break;
         case PSR_TITLE_NUMBER:
             _queue_event(bd, BD_EVENT_TITLE,    ev->new_val);
+            libbdplus_event(bd->libbdplus, 0x110, ev->new_val, 0);
             break;
         case PSR_PLAYLIST:
             _queue_event(bd, BD_EVENT_PLAYLIST, ev->new_val);
@@ -2760,6 +2763,9 @@ int bd_play(BLURAY *bd)
     _queue_initial_psr_events(bd);
     bd_psr_unlock(bd->regs);
 
+    /* start BD+ VM */
+    libbdplus_start(bd->libbdplus);
+
     /* start playback from FIRST PLAY title */
 
     result = _play_title(bd, BLURAY_TITLE_FIRST_PLAY);



More information about the libbluray-devel mailing list