1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00

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.
This commit is contained in:
xylosper 2014-03-27 03:19:14 +09:00 committed by wm4
parent 6c947c64a1
commit facba0b317

View File

@ -64,6 +64,7 @@ struct bluray_priv_s {
int num_titles; int num_titles;
int current_angle; int current_angle;
int current_title; int current_title;
int current_playlist;
int cfg_title; int cfg_title;
char *cfg_device; 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; struct bluray_priv_s *b = s->priv;
switch (ev->event) { 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: case BD_EVENT_TITLE:
if (ev->param == BLURAY_TITLE_FIRST_PLAY) if (ev->param == BLURAY_TITLE_FIRST_PLAY)
b->current_title = bd_get_current_title(b->bd); 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); bd_free_title_info(b->title_info);
b->title_info = NULL; b->title_info = NULL;
} }
b->title_info = bd_get_title_info(b->bd, b->current_title,
b->current_angle);
break; break;
case BD_EVENT_ANGLE: case BD_EVENT_ANGLE:
b->current_angle = ev->param; b->current_angle = ev->param;
if (b->title_info) { if (b->title_info) {
bd_free_title_info(b->title_info); bd_free_title_info(b->title_info);
b->title_info = bd_get_title_info(b->bd, b->current_title, b->title_info = bd_get_playlist_info(b->bd, b->current_playlist,
b->current_angle); b->current_angle);
} }
break; break;
case BD_EVENT_IDLE: case BD_EVENT_IDLE: