epggrab: ota - fix the stolen mux requeue

This commit is contained in:
Jaroslav Kysela 2014-11-05 19:25:35 +01:00
parent 9ed76a5753
commit b11b218d7b
2 changed files with 7 additions and 4 deletions

View file

@ -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?

View file

@ -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;