From: Adam Sutton Date: Sat, 21 Sep 2013 18:45:55 +0000 (+0100) Subject: epggrab: ensure that grabs that timeout will unsubscribe X-Git-Tag: v4.1~2490 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f16c2eed57b35101d56a979ebfaab8cd4a89bd8;p=thirdparty%2Ftvheadend.git epggrab: ensure that grabs that timeout will unsubscribe --- diff --git a/src/epggrab/otamux.c b/src/epggrab/otamux.c index 40ee2626e..0d314e2fa 100644 --- a/src/epggrab/otamux.c +++ b/src/epggrab/otamux.c @@ -104,11 +104,17 @@ epggrab_ota_timeout ( epggrab_ota_mux_t *ota ) static void epggrab_ota_done ( epggrab_ota_mux_t *ota, int timeout ) { + mpegts_mux_t *mm; + LIST_REMOVE(ota, om_q_link); ota->om_active = 0; ota->om_when = dispatch_clock + epggrab_ota_period(ota); LIST_INSERT_SORTED(&epggrab_ota_pending, ota, om_q_link, om_time_cmp); + /* Remove subscriber */ + if ((mm = mpegts_mux_find(ota->om_mux_uuid))) + mpegts_mux_unsubscribe_by_name(mm, "epggrab"); + /* Re-arm */ if (LIST_FIRST(&epggrab_ota_pending) == ota) epggrab_ota_pending_timer_cb(NULL); @@ -236,7 +242,6 @@ epggrab_ota_complete { int done = 1; epggrab_ota_map_t *map; - mpegts_mux_t *mm; tvhinfo(mod->id, "grab complete"); /* Test for completion */ @@ -249,10 +254,6 @@ epggrab_ota_complete } if (!done) return; - /* Remove subscriber */ - if ((mm = mpegts_mux_find(ota->om_mux_uuid))) - mpegts_mux_unsubscribe_by_name(mm, "epggrab"); - /* Done */ epggrab_ota_done(ota, 0); }