From d58410d8170e93b8ab776b23ea1bf9ae95a5d68e Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Wed, 4 Dec 2013 22:37:45 +0000 Subject: [PATCH] epggrab: ensure muxes with no (or disabled) modules aren't started --- src/epggrab/otamux.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/epggrab/otamux.c b/src/epggrab/otamux.c index 616b1810..dd0cdd64 100644 --- a/src/epggrab/otamux.c +++ b/src/epggrab/otamux.c @@ -317,6 +317,20 @@ epggrab_ota_pending_timer_cb ( void *p ) goto done; } + /* Check we have modules attached and enabled */ + LIST_FOREACH(map, &om->om_modules, om_link) { + if (map->om_module->enabled) + break; + } + if (!map) { + char name[256]; + mm->mm_display_name(mm, name, sizeof(name)); + tvhdebug("epggrab", "no modules attached to %s, check again later", name); + om->om_when = dispatch_clock + epggrab_ota_period(om) / 2; + LIST_INSERT_SORTED(&epggrab_ota_pending, om, om_q_link, om_time_cmp); + goto done; + } + /* Insert into active (assume success) */ // Note: if we don't do this the subscribe below can result in a mux // start call which means we call it a second time below