From c78c33bf7c10e81eebc4b4c1b66d0d74306887de Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 20 Oct 2023 20:08:06 +0200 Subject: [PATCH] stream_dvb: avoid static function variable --- stream/dvbin.h | 1 + stream/stream_dvb.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stream/dvbin.h b/stream/dvbin.h index ba7851669f..7c179bf77b 100644 --- a/stream/dvbin.h +++ b/stream/dvbin.h @@ -103,6 +103,7 @@ typedef struct { char *prog; int devno; + int opts_check_time; dvb_opts_t *opts; struct m_config_cache *opts_cache; } dvb_priv_t; diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 8bb785bf89..7d68c1ec01 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -933,13 +933,12 @@ static int dvb_streaming_start(stream_t *stream, char *progname) void dvb_update_config(stream_t *stream) { - static int last_check = 0; + dvb_priv_t *priv = stream->priv; int now = (int)(mp_time_sec()*10); // Throttle the check to at maximum once every 0.1 s. - if (now != last_check) { - last_check = now; - dvb_priv_t *priv = (dvb_priv_t *) stream->priv; + if (now != priv->opts_check_time) { + priv->opts_check_time = now; if (m_config_cache_update(priv->opts_cache)) { dvb_state_t *state = priv->state;