summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2014-03-27 03:15:37 +0900
committerwm4 <wm4@nowhere>2014-03-26 21:00:47 +0100
commit4086a096955fd71876444d9f0e52b55952111478 (patch)
tree6d90de1802f1f349fcbbaad09c62139cf0ad53a1 /stream
parentb292ca8702f88758ef0e08206c28ae674070a45c (diff)
downloadmpv-4086a096955fd71876444d9f0e52b55952111478.tar.bz2
mpv-4086a096955fd71876444d9f0e52b55952111478.tar.xz
stream_bluray: implement event handler for libbluray
This commit brings libbluray's event queue into stream_bluray. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_bluray.c16
1 files changed, 16 insertions, 0 deletions
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;