From b11b218d7b2a49726e07133f106d852f7fbbd1ed Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 5 Nov 2014 19:25:35 +0100 Subject: [PATCH] epggrab: ota - fix the stolen mux requeue --- src/epggrab.h | 7 ++++--- src/epggrab/otamux.c | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/epggrab.h b/src/epggrab.h index 518dcb4c..352e90ad 100644 --- a/src/epggrab.h +++ b/src/epggrab.h @@ -203,9 +203,10 @@ struct epggrab_ota_mux char *om_mux_uuid; ///< Soft-link to mux LIST_HEAD(,epggrab_ota_map) om_modules; ///< List of linked mods - int om_done; ///< The full completion mark for this round - int om_complete; ///< Has completed a scan - int om_save; ///< something changed + uint8_t om_done; ///< The full completion mark for this round + uint8_t om_complete; ///< Has completed a scan + uint8_t om_requeue; ///< Requeue when stolen + uint8_t om_save; ///< something changed gtimer_t om_timer; ///< Per mux active timer gtimer_t om_data_timer; ///< Any EPG data seen? diff --git a/src/epggrab/otamux.c b/src/epggrab/otamux.c index 310d87ec..0caa6079 100644 --- a/src/epggrab/otamux.c +++ b/src/epggrab/otamux.c @@ -110,6 +110,7 @@ epggrab_ota_requeue ( void ) */ RB_FOREACH(om, &epggrab_ota_all, om_global_link) { om->om_done = 0; + om->om_requeue = 1; if (om->om_q_type != EPGGRAB_OTA_MUX_IDLE) continue; TAILQ_INSERT_TAIL(&epggrab_ota_pending, om, om_q_link); @@ -160,7 +161,7 @@ epggrab_ota_done ( epggrab_ota_mux_t *om, int reason ) om->om_q_type = EPGGRAB_OTA_MUX_IDLE; if (reason == EPGGRAB_OTA_DONE_STOLEN) { /* Do not requeue completed muxes */ - if (!om->om_done) { + if (!om->om_done && om->om_requeue) { TAILQ_INSERT_HEAD(&epggrab_ota_pending, om, om_q_link); om->om_q_type = EPGGRAB_OTA_MUX_PENDING; } @@ -499,6 +500,7 @@ next_one: om->om_force_modname = modname ? strdup(modname) : NULL; /* Subscribe to the mux */ + om->om_requeue = 1; if ((r = mpegts_mux_subscribe(mm, "epggrab", SUBSCRIPTION_PRIO_EPG))) { TAILQ_INSERT_TAIL(&epggrab_ota_pending, om, om_q_link); om->om_q_type = EPGGRAB_OTA_MUX_PENDING;