From 3af5f7182c5b66a824a53e67e6dd05e903842d99 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 29 Jun 2012 13:42:46 +0100 Subject: [PATCH] Minor tweak. --- src/epggrab/otamux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/epggrab/otamux.c b/src/epggrab/otamux.c index 1166f951..1d8bf6ef 100644 --- a/src/epggrab/otamux.c +++ b/src/epggrab/otamux.c @@ -81,9 +81,12 @@ int epggrab_mux_period ( th_dvb_mux_instance_t *tdmi ) th_dvb_mux_instance_t *epggrab_mux_next ( th_dvb_adapter_t *tda ) { + time_t now; epggrab_ota_mux_t *ota; + time(&now); TAILQ_FOREACH(ota, &ota_mux_all, glob_link) { - if (!ota->is_reg) break; + if (ota->interval + ota->completed > now) return NULL; + if (!ota->is_reg) return NULL; if (ota->tdmi->tdmi_adapter == tda) break; } return ota ? ota->tdmi : NULL;