0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

stream_dvb: avoid static function variable

This commit is contained in:
sfan5 2023-10-20 20:08:06 +02:00
parent 2569c69d92
commit c78c33bf7c
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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;