From facba0b31709679d82b561b76f6e5649603453e5 Mon Sep 17 00:00:00 2001 From: xylosper Date: Thu, 27 Mar 2014 03:19:14 +0900 Subject: stream_bluray: use bd_get_playlist_info() Use bd_get_playlist_info() instead of bd_get_title_info(). The previous implementation couldn't query current playlist and this made it impossible to call bd_get_playlist_info() which is more desirable than bd_get_title_info() because, for Blu-rays, playlist is the unit of playback not title. This commit fixes that. --- stream/stream_bluray.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index 4430cef482..4c0658e389 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -64,6 +64,7 @@ struct bluray_priv_s { int num_titles; int current_angle; int current_title; + int current_playlist; int cfg_title; char *cfg_device; @@ -106,6 +107,13 @@ static void handle_event(stream_t *s, const BD_EVENT *ev) { struct bluray_priv_s *b = s->priv; switch (ev->event) { + case BD_EVENT_PLAYLIST: + b->current_playlist = ev->param; + if (b->title_info) + bd_free_title_info(b->title_info); + b->title_info = bd_get_playlist_info(b->bd, b->current_playlist, + b->current_angle); + break; case BD_EVENT_TITLE: if (ev->param == BLURAY_TITLE_FIRST_PLAY) b->current_title = bd_get_current_title(b->bd); @@ -115,15 +123,13 @@ static void handle_event(stream_t *s, const BD_EVENT *ev) bd_free_title_info(b->title_info); b->title_info = NULL; } - b->title_info = bd_get_title_info(b->bd, b->current_title, - b->current_angle); break; case BD_EVENT_ANGLE: b->current_angle = ev->param; if (b->title_info) { bd_free_title_info(b->title_info); - b->title_info = bd_get_title_info(b->bd, b->current_title, - b->current_angle); + b->title_info = bd_get_playlist_info(b->bd, b->current_playlist, + b->current_angle); } break; case BD_EVENT_IDLE: -- cgit v1.2.3