summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2014-03-27 03:19:14 +0900
committerwm4 <wm4@nowhere>2014-03-26 21:00:48 +0100
commitfacba0b31709679d82b561b76f6e5649603453e5 (patch)
tree48977716285b2cad881d312cf792b4273ba0434b
parent6c947c64a17c28eefe5179bd71ab077d6c2bbd0d (diff)
downloadmpv-facba0b31709679d82b561b76f6e5649603453e5.tar.bz2
mpv-facba0b31709679d82b561b76f6e5649603453e5.tar.xz
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.
-rw-r--r--stream/stream_bluray.c14
1 files 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: