Skip to content

Commit 9dec5b5

Browse files
ast261Flole998
authored andcommitted
fixes #1733
1 parent 9ac57a0 commit 9dec5b5

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎src/epggrab.c‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,23 @@ static void *_epggrab_internal_thread( void *aux )
116116
if (err == ETIMEDOUT) break;
117117
}
118118

119-
clock_gettime(CLOCK_REALTIME, &cron_next);
120-
cron_next.tv_nsec = 0;
121-
122119
while (atomic_get(&epggrab_running)) {
123120

124-
/* Check for config change */
125121
tvh_mutex_lock(&epggrab_mutex);
122+
123+
clock_gettime(CLOCK_REALTIME, &current_time);
124+
if (!cron_multi_next(epggrab_cron_multi, current_time.tv_sec, &t))
125+
cron_next.tv_sec = t;
126+
else
127+
cron_next.tv_sec += 60;
128+
129+
/* Check for config change */
126130
while (atomic_get(&epggrab_running) && confver == epggrab_confver) {
127131
err = tvh_cond_timedwait_ts(&epggrab_cond, &epggrab_mutex, &cron_next);
128132
if (err == ETIMEDOUT) break;
129133
}
130134
confver = epggrab_confver;
131135

132-
clock_gettime(CLOCK_REALTIME, &current_time);
133-
if (!cron_multi_next(epggrab_cron_multi, current_time.tv_sec, &t))
134-
cron_next.tv_sec = t;
135-
else
136-
cron_next.tv_sec += 60;
137136
tvh_mutex_unlock(&epggrab_mutex);
138137

139138
/* Run grabber(s) */

0 commit comments

Comments
 (0)