summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorOliver Freyermuth <o.freyermuth@googlemail.com>2016-01-08 20:36:23 +0100
committerwm4 <wm4@nowhere>2016-01-14 00:36:53 +0100
commit77bac5b5507e04d6a31bb4387af79105fc3869b9 (patch)
tree17a26bf5f1e3864d56a9c044db600f364c25274f /player/command.c
parent64067a9b7c639fc76baf2301f17443e07e61e70e (diff)
downloadmpv-77bac5b5507e04d6a31bb4387af79105fc3869b9.tar.bz2
mpv-77bac5b5507e04d6a31bb4387af79105fc3869b9.tar.xz
player: implement SWITCH for dvb-channel-name property, add binding.
The binding is similar to the tv-binding, just with capital letters. Switching the dvb-channel-name property compared to dvb-channel means the channel-name is shown on-screen when switching instead of "dvb-channel (error)" otherwise, and switching anyways happens without changing the card.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index a76ae6cf3c..5355363920 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3008,6 +3008,14 @@ static int mp_property_dvb_channel_name(void *ctx, struct m_property *prop,
if (r == M_PROPERTY_OK && !mpctx->stop_play)
mpctx->stop_play = PT_RELOAD_FILE;
return r;
+ case M_PROPERTY_SWITCH: {
+ struct m_property_switch_arg *sa = arg;
+ int dir = sa->inc >= 0 ? 1 : -1;
+ r = prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_STEP_CHANNEL, &dir);
+ if (r == M_PROPERTY_OK && !mpctx->stop_play)
+ mpctx->stop_play = PT_RELOAD_FILE;
+ return r;
+ }
case M_PROPERTY_GET: {
return prop_stream_ctrl(mpctx, STREAM_CTRL_DVB_GET_CHANNEL_NAME, arg);
}