summaryrefslogtreecommitdiffstats
path: root/player/command.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 /player/command.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 'player/command.c')
-rw-r--r--player/command.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index e15d3db54e..d9854af9e8 100644
--- a/player/command.c
+++ b/player/command.c
@@ -436,7 +436,7 @@ static int mp_property_playtime_remaining(m_option_t *prop, int action,
return property_time(prop, action, arg, remaining / speed);
}
-/// Current BD/DVD title (RO)
+/// Current BD/DVD title (RW)
static int mp_property_disc_title(m_option_t *prop, int action, void *arg,
MPContext *mpctx)
{
@@ -449,7 +449,13 @@ static int mp_property_disc_title(m_option_t *prop, int action, void *arg,
case M_PROPERTY_GET:
if (stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &title) <= 0)
return M_PROPERTY_UNAVAILABLE;
- return m_property_int_ro(prop, action, arg, title);
+ *(int*)arg = title;
+ return M_PROPERTY_OK;
+ case M_PROPERTY_SET:
+ title = *(int*)arg;
+ if (stream_control(stream, STREAM_CTRL_SET_CURRENT_TITLE, &title) <= 0)
+ return M_PROPERTY_NOT_IMPLEMENTED;
+ return M_PROPERTY_OK;
default:
return M_PROPERTY_NOT_IMPLEMENTED;
}