summaryrefslogtreecommitdiffstats
path: root/stream/stream_bluray.c
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2014-03-18 13:03:00 +0900
committerwm4 <wm4@nowhere>2014-03-18 15:24:45 +0100
commitd2e35b2faafab1dfcf5e4acbdc36b569d3834b9a (patch)
tree1ec385de7524e9d0aa3fe707c37091850db6eb59 /stream/stream_bluray.c
parent5c2b4d9356f62781fa01f67f1fa881f7f2d8efb1 (diff)
downloadmpv-d2e35b2faafab1dfcf5e4acbdc36b569d3834b9a.tar.bz2
mpv-d2e35b2faafab1dfcf5e4acbdc36b569d3834b9a.tar.xz
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.
Diffstat (limited to 'stream/stream_bluray.c')
-rw-r--r--stream/stream_bluray.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index 83d26c05fb..e606eafbb5 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -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;