From 4086a096955fd71876444d9f0e52b55952111478 Mon Sep 17 00:00:00 2001 From: xylosper Date: Thu, 27 Mar 2014 03:15:37 +0900 Subject: stream_bluray: implement event handler for libbluray This commit brings libbluray's event queue into stream_bluray. Signed-off-by: wm4 --- stream/stream_bluray.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'stream') diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index b0347751d6..b694c71a8b 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -42,6 +42,7 @@ #include "common/msg.h" #include "options/m_option.h" #include "stream.h" +#include "osdep/timer.h" #define BLURAY_SECTOR_SIZE 6144 @@ -98,10 +99,22 @@ static int bluray_stream_seek(stream_t *s, int64_t pos) return 1; } +static void handle_event(stream_t *s, const BD_EVENT *ev) +{ + switch (ev->event) { + default: + MP_TRACE(s, "Unhandled event: %d %d\n", ev->event, ev->param); + break; + } +} + static int bluray_stream_fill_buffer(stream_t *s, char *buf, int len) { struct bluray_priv_s *b = s->priv; + BD_EVENT event; + while (bd_get_event(b->bd, &event)) + handle_event(s, &event); return bd_read(b->bd, buf, len); } @@ -345,6 +358,9 @@ static int bluray_stream_open(stream_t *s, int mode) bd_free_title_info(ti); } + // initialize libbluray event queue + bd_get_event(bd, NULL); + /* Select current title */ if (b->cfg_title != BLURAY_DEFAULT_TITLE) title = b->cfg_title; -- cgit v1.2.3