From 66fc8dcb3fc879ec6c032d9eb7100d7bc0509ac4 Mon Sep 17 00:00:00 2001 From: phintuka Date: Wed, 15 Dec 2010 14:57:29 +0000 Subject: Handle BD_EVENT_STILL_TIME. Fixes menus with still image background. --- xine/BluRay/input_bluray.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c index 5abf8e01..3a7e3e87 100644 --- a/xine/BluRay/input_bluray.c +++ b/xine/BluRay/input_bluray.c @@ -322,6 +322,39 @@ 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) { + stream_flush(this); + 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) { @@ -345,6 +378,11 @@ 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; -- cgit v1.2.3