summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/player/command.c b/player/command.c
index 55ad018c8c..292384f2d9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -907,7 +907,7 @@ static int mp_property_disc_title(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
struct demuxer *d = mpctx->demuxer;
- if (!d)
+ if (!d || !d->extended_ctrls)
return M_PROPERTY_UNAVAILABLE;
unsigned int title = -1;
switch (action) {
@@ -1224,8 +1224,9 @@ static int mp_property_disc_titles(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
struct demuxer *demuxer = mpctx->demuxer;
unsigned int num_titles;
- if (!demuxer || demux_stream_control(demuxer, STREAM_CTRL_GET_NUM_TITLES,
- &num_titles) < 1)
+ if (!demuxer || !demuxer->extended_ctrls ||
+ demux_stream_control(demuxer, STREAM_CTRL_GET_NUM_TITLES,
+ &num_titles) < 1)
return M_PROPERTY_UNAVAILABLE;
return m_property_int_ro(action, arg, num_titles);
}
@@ -1255,8 +1256,9 @@ static int mp_property_list_disc_titles(void *ctx, struct m_property *prop,
MPContext *mpctx = ctx;
struct demuxer *demuxer = mpctx->demuxer;
unsigned int num_titles;
- if (!demuxer || demux_stream_control(demuxer, STREAM_CTRL_GET_NUM_TITLES,
- &num_titles) < 1)
+ if (!demuxer || !demuxer->extended_ctrls ||
+ demux_stream_control(demuxer, STREAM_CTRL_GET_NUM_TITLES,
+ &num_titles) < 1)
return M_PROPERTY_UNAVAILABLE;
return m_property_read_list(action, arg, num_titles,
get_disc_title_entry, mpctx);
@@ -1291,7 +1293,7 @@ static int mp_property_angle(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
struct demuxer *demuxer = mpctx->demuxer;
- if (!demuxer)
+ if (!demuxer || !demuxer->extended_ctrls)
return M_PROPERTY_UNAVAILABLE;
int ris, angles = -1, angle = 1;
@@ -3117,7 +3119,7 @@ static int mp_property_cursor_autohide(void *ctx, struct m_property *prop,
static int prop_stream_ctrl(struct MPContext *mpctx, int ctrl, void *arg)
{
- if (!mpctx->demuxer)
+ if (!mpctx->demuxer || !mpctx->demuxer->extended_ctrls)
return M_PROPERTY_UNAVAILABLE;
int r = demux_stream_control(mpctx->demuxer, ctrl, arg);
switch (r) {
@@ -5506,7 +5508,7 @@ static void cmd_tv_last_channel(void *p)
struct mp_cmd_ctx *cmd = p;
struct MPContext *mpctx = cmd->mpctx;
- if (!mpctx->demuxer) {
+ if (!mpctx->demuxer || !mpctx->demuxer->extended_ctrls) {
cmd->success = false;
return;
}