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

git at videolan.org git at videolan.org
Fri Dec 17 13:39:35 CET 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Dec 17 14:37:55 2010 +0200| [727b375f03d8567dab10b9c92aca074de37cecec] | committer: hpi1 

updated xine plugin:
- merged still mode support. Fixes immediate exit from menus with still image backgrounds.

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

 player_wrappers/xine/input_bluray.c |   45 +++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/player_wrappers/xine/input_bluray.c b/player_wrappers/xine/input_bluray.c
index 1904dee..14cf466 100644
--- a/player_wrappers/xine/input_bluray.c
+++ b/player_wrappers/xine/input_bluray.c
@@ -254,6 +254,38 @@ static void stream_reset(bluray_input_plugin_t *this)
   this->cap_seekable = INPUT_CAP_SEEKABLE;
 }
 
+static void wait_secs(bluray_input_plugin_t *this, unsigned seconds)
+{
+  // infinite still mode ?
+  if (!seconds) {
+    xine_usec_sleep(10*1000);
+    return;
+  }
+
+  // clip to allowed range
+  if (seconds > 300) {
+    seconds = 300;
+  }
+
+  // pause the stream
+  int paused = _x_get_fine_speed(this->stream) == XINE_SPEED_PAUSE;
+  if (!paused) {
+    _x_set_fine_speed(this->stream, XINE_SPEED_PAUSE);
+  }
+
+  // wait until interrupted
+  int loops = seconds * 25; /* N * 40 ms */
+  while (!this->stream->demux_action_pending && loops-- > 0) {
+    xine_usec_sleep(40*1000);
+  }
+
+  lprintf("paused for %d seconds (%d ms left)\n", seconds - loops/25, loops * 40);
+
+  if (!paused) {
+    _x_set_fine_speed(this->stream, XINE_FINE_SPEED_NORMAL);
+  }
+}
+
 static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
 {
     switch (ev.event) {
@@ -276,7 +308,20 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
         stream_reset(this);
         break;
 
+      case BD_EVENT_STILL_TIME:
+        lprintf("BD_EVENT_STILL_TIME %d\n", ev.param);
+        wait_secs(this, ev.param);
+        break;
+
       case BD_EVENT_STILL:
+        lprintf("BD_EVENT_STILL %d\n", ev.param);
+        int paused = _x_get_fine_speed(this->stream) == XINE_SPEED_PAUSE;
+        if (paused && !ev.param) {
+          _x_set_fine_speed(this->stream, XINE_FINE_SPEED_NORMAL);
+        }
+        if (!paused && ev.param) {
+          _x_set_fine_speed(this->stream, XINE_SPEED_PAUSE);
+        }
         break;
 
       /* playback position */



More information about the libbluray-devel mailing list