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;