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:
parent
6c947c64a1
commit
facba0b317
@ -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,14 +123,12 @@ 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->title_info = bd_get_playlist_info(b->bd, b->current_playlist,
|
||||
b->current_angle);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user