Skip to content

Commit

Permalink
stream_dvb: avoid static function variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Oct 21, 2023
1 parent 2569c69 commit c78c33b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions stream/dvbin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions stream/stream_dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c78c33b

Please sign in to comment.