[libbluray-devel] commit: updated xine plugin: (hpi1 )

git at videolan.org git at videolan.org
Fri Dec 17 13:27:05 CET 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Dec 17 14:25:51 2010 +0200| [d7f76bace448a830d17878cafb5b98aba751b9cb] | committer: hpi1 

updated xine plugin:
- merged bug fixes and error handling

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

 player_wrappers/xine/input_bluray.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/player_wrappers/xine/input_bluray.c b/player_wrappers/xine/input_bluray.c
index 5f83760..01eb48f 100644
--- a/player_wrappers/xine/input_bluray.c
+++ b/player_wrappers/xine/input_bluray.c
@@ -247,6 +247,13 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
         this->error = 1;
         return;
 
+      case BD_EVENT_ENCRYPTED:
+        lprintf("BD_EVENT_ENCRYPTED\n");
+        _x_message (this->stream, XINE_MSG_ENCRYPTED_SOURCE,
+                    "Media stream scrambled/encrypted", NULL);
+        this->error = 1;
+        return;
+
       /* playback control */
 
       case BD_EVENT_STILL:
@@ -266,12 +273,16 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
       case BD_EVENT_PLAYLIST:
         lprintf("BD_EVENT_PLAYLIST %d\n", ev.param);
         this->current_title_idx = bd_get_current_title(this->bdh);
+        this->current_clip = 0;
         update_title_info(this);
         break;
 
       case BD_EVENT_PLAYITEM:
         lprintf("BD_EVENT_PLAYITEM %d\n", ev.param);
-        this->current_clip = ev.param;
+        if (ev.param < this->title_info->clip_count)
+          this->current_clip = ev.param;
+        else
+          this->current_clip = 0;
         break;
 
       case BD_EVENT_CHAPTER:
@@ -490,7 +501,7 @@ static off_t bluray_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
   bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
   off_t result;
 
-  if (!this || !this->bdh || len < 0)
+  if (!this || !this->bdh || len < 0 || this->error)
     return -1;
 
   handle_events(this);
@@ -547,6 +558,8 @@ static off_t bluray_plugin_seek (input_plugin_t *this_gen, off_t offset, int ori
 
   if (!this || !this->bdh)
     return -1;
+  if (this->current_title_idx < 0)
+    return offset;
 
   /* convert relative seeks to absolute */
 



More information about the libbluray-devel mailing list