diff --git a/src/dvb/dvb_multiplex.c b/src/dvb/dvb_multiplex.c index 1d5cbc97..9e67fcd5 100644 --- a/src/dvb/dvb_multiplex.c +++ b/src/dvb/dvb_multiplex.c @@ -289,6 +289,8 @@ dvb_mux_create(th_dvb_adapter_t *tda, const struct dvb_mux_conf *dmc, mux_link_initial(tda, tdmi); } + TAILQ_INIT(&tdmi->tdmi_epg_grab); + return tdmi; } diff --git a/src/epggrab.c b/src/epggrab.c index 643af33b..8036d733 100644 --- a/src/epggrab.c +++ b/src/epggrab.c @@ -308,6 +308,10 @@ void epggrab_resched ( void ) */ void epggrab_init ( void ) { + /* Lists */ + extern TAILQ_HEAD(, epggrab_ota_mux) ota_mux_all; + TAILQ_INIT(&ota_mux_all); + /* Initialise modules */ eit_init(); xmltv_init(); diff --git a/src/epggrab/module.c b/src/epggrab/module.c index 52f48c9a..e34f3272 100644 --- a/src/epggrab/module.c +++ b/src/epggrab/module.c @@ -487,6 +487,7 @@ epggrab_module_ota_t *epggrab_module_ota_create skel->type = EPGGRAB_OTA; skel->enable = enable; skel->start = start; + TAILQ_INIT(&skel->muxes); return skel; } diff --git a/src/epggrab/module/opentv.c b/src/epggrab/module/opentv.c index 0513f1ff..21d384c1 100644 --- a/src/epggrab/module/opentv.c +++ b/src/epggrab/module/opentv.c @@ -122,7 +122,7 @@ typedef struct opentv_dict /* Provider configuration */ typedef struct opentv_module_t { - epggrab_module_t ; ///< Base struct + epggrab_module_ota_t ; ///< Base struct int nid; int tsid; @@ -505,7 +505,7 @@ static int _opentv_bat_section * Table Callbacks * ***********************************************************************/ -static epggrab_ota_mux_t *_opentv_table_callback +static epggrab_ota_mux_t *_opentv_event_callback ( th_dvb_mux_instance_t *tdmi, uint8_t *buf, int len, uint8_t tid, void *p ) { th_dvb_table_t *tdt = (th_dvb_table_t*)p; @@ -568,7 +568,7 @@ static epggrab_ota_mux_t *_opentv_table_callback static int _opentv_title_callback ( th_dvb_mux_instance_t *tdmi, uint8_t *buf, int len, uint8_t tid, void *p ) { - epggrab_ota_mux_t *ota = _opentv_table_callback(tdmi, buf, len, tid, p); + epggrab_ota_mux_t *ota = _opentv_event_callback(tdmi, buf, len, tid, p); if (ota) return _opentv_parse_event_section((opentv_module_t*)ota->grab, (opentv_status_t*)ota->status, @@ -579,7 +579,7 @@ static int _opentv_title_callback static int _opentv_summary_callback ( th_dvb_mux_instance_t *tdmi, uint8_t *buf, int len, uint8_t tid, void *p ) { - epggrab_ota_mux_t *ota = _opentv_table_callback(tdmi, buf, len, tid, p); + epggrab_ota_mux_t *ota = _opentv_event_callback(tdmi, buf, len, tid, p); if (ota) return _opentv_parse_event_section((opentv_module_t*)ota->grab, (opentv_status_t*)ota->status, diff --git a/src/epggrab/otamux.c b/src/epggrab/otamux.c index 1d8bf6ef..ee4f3956 100644 --- a/src/epggrab/otamux.c +++ b/src/epggrab/otamux.c @@ -72,7 +72,7 @@ int epggrab_mux_period ( th_dvb_mux_instance_t *tdmi ) int period = 0; epggrab_ota_mux_t *ota; TAILQ_FOREACH(ota, &tdmi->tdmi_epg_grab, tdmi_link) { - if (!ota->is_reg) break; + if (!ota->is_reg) continue; if (ota->timeout > period) period = ota->timeout; } @@ -146,7 +146,7 @@ epggrab_ota_mux_t *epggrab_ota_create } else { time_t now; time(&now); - if (ota) ota->state = EPGGRAB_OTA_MUX_IDLE; + ota->state = EPGGRAB_OTA_MUX_IDLE; /* Blocked */ if (epggrab_ota_is_blocked(ota)) ota = NULL;