mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
command: make 'disc-title' property writable
This commit makes 'disc-title' property writable using STREAM_CTRL_SET_CURRENT_TITLE. This commit also contains implementation of STREAM_CTRL_SET_CURRENT_TITLE for stream_bluray. Currently, 'disc-title' is writable only for stream_dvdnav and stream_bluray and stream_dvd is not supported.
This commit is contained in:
@@ -143,7 +143,14 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg)
|
||||
}
|
||||
return STREAM_ERROR;
|
||||
}
|
||||
|
||||
case STREAM_CTRL_SET_CURRENT_TITLE: {
|
||||
const uint32_t title = *((unsigned int*)arg);
|
||||
if (title < b->num_titles && bd_select_title(b->bd, title)) {
|
||||
b->current_title = title;
|
||||
return STREAM_OK;
|
||||
}
|
||||
return STREAM_ERROR;
|
||||
}
|
||||
case STREAM_CTRL_GET_CURRENT_TITLE: {
|
||||
*((unsigned int *) arg) = b->current_title;
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user