mirror of
https://github.com/mpv-player/mpv
synced 2024-10-02 16:25:33 +02:00
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.
This commit is contained in:
parent
64067a9b7c
commit
77bac5b550
@ -166,6 +166,10 @@
|
||||
#h cycle tv-channel -1 # previous channel
|
||||
#k cycle tv-channel +1 # next channel
|
||||
|
||||
# For dvb://
|
||||
#H cycle dvb-channel-name -1 # previous channel
|
||||
#K cycle dvb-channel-name +1 # next channel
|
||||
|
||||
#
|
||||
# Legacy bindings (may or may not be removed in the future)
|
||||
#
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user