[libbluray-devel] commit: Added bd_seek_playitem() for HDMV_EVENT_PLAY_PI (hpi1 )

git at videolan.org git at videolan.org
Fri Dec 17 12:43:28 CET 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Dec 17 13:42:09 2010 +0200| [3253e62a7cb7a81670471faedf615fb45791e9f0] | committer: hpi1 

Added bd_seek_playitem() for HDMV_EVENT_PLAY_PI

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

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

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 590a118..dceda61 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -900,6 +900,26 @@ uint32_t bd_get_current_chapter(BLURAY *bd)
     return 0;
 }
 
+int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
+{
+    uint32_t clip_pkt, out_pkt;
+    NAV_CLIP *clip;
+
+    if (bd->title &&
+        clip_ref < bd->title->clip_list.count) {
+
+      _change_angle(bd);
+
+      clip     = &bd->title->clip_list.clip[clip_ref];
+      clip_pkt = clip->start_pkt;
+      out_pkt  = clip->pos;
+
+      return _seek_internal(bd, clip, out_pkt, clip_pkt);
+    }
+
+    return bd->s_pos;
+}
+
 int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
 {
     uint32_t clip_pkt, out_pkt;
@@ -1806,12 +1826,8 @@ static void _process_hdmv_vm_event(BLURAY *bd, HDMV_EVENT *hev)
             break;
 
         case HDMV_EVENT_PLAY_PI:
-#if 0
             _queue_event(bd, (BD_EVENT){BD_EVENT_SEEK, 0});
-            bd_seek_pi(bd, hev->param);
-#else
-            DEBUG(DBG_BLURAY|DBG_CRIT, "HDMV_EVENT_PLAY_PI: not implemented\n");
-#endif
+            bd_seek_playitem(bd, hev->param);
             break;
 
         case HDMV_EVENT_PLAY_PM:



More information about the libbluray-devel mailing list