diff options
author | Oliver Freyermuth <o.freyermuth@googlemail.com> | 2019-10-01 23:54:54 +0200 |
---|---|---|
committer | Oliver Freyermuth <o.freyermuth@googlemail.com> | 2019-10-02 01:25:45 +0200 |
commit | 12d74e4d955edd1c6c02df34be08a1020c20abee (patch) | |
tree | c8ec7a8f51cece1f8982f56accfeed579c8684f3 /stream/stream_dvb.c | |
parent | c408a48119cecca71db0d06aff4aca7b4d9e84d7 (diff) | |
download | mpv-12d74e4d955edd1c6c02df34be08a1020c20abee.tar.bz2 mpv-12d74e4d955edd1c6c02df34be08a1020c20abee.tar.xz |
stream_dvb: Allow actual zapping of channels again.
This is realized by dvbin-channel-switch-offset,
which is a numeric offset on the channel initially tuned to.
Since the channel list is kept in the stream alone
depending on detected hardware and chosen card,
and no available backchannel to the player, there's no direct
property which could be switched.
Using input.conf like:
H cycle dvbin-channel-switch-offset up
K cycle dvbin-channel-switch-offset down
Q set dvbin-prog "ZDF HD"
allow fast and reliable channel switching again.
Diffstat (limited to 'stream/stream_dvb.c')
-rw-r--r-- | stream/stream_dvb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 5291ef9860..6f47aed2fc 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -78,6 +78,7 @@ const struct m_sub_options stream_dvb_conf = { OPT_INTRANGE("timeout", cfg_timeout, 0, 1, 30), OPT_STRING("file", cfg_file, M_OPT_FILE), OPT_FLAG("full-transponder", cfg_full_transponder, 0), + OPT_INT("channel-switch-offset", cfg_channel_switch_offset, 0), {0} }, .size = sizeof(dvb_opts_t), @@ -1044,6 +1045,12 @@ static int dvb_streaming_start(stream_t *stream, char *progname) } list->current = i; + + // When switching channels, cfg_channel_switch_offset + // keeps the offset to the initially chosen channel. + list->current = (list->NUM_CHANNELS + list->current + priv->opts->cfg_channel_switch_offset) % list->NUM_CHANNELS; + channel = &(list->channels[list->current]); + MP_INFO(stream, "Tuning to channel \"%s\"...\n", channel->name); MP_VERBOSE(stream, "PROGRAM NUMBER %d: name=%s, freq=%u\n", i, channel->name, channel->freq); |