]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epggrab: ota - fix the stolen mux requeue
authorJaroslav Kysela <perex@perex.cz>
Wed, 5 Nov 2014 18:25:35 +0000 (19:25 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 8 Nov 2014 20:05:38 +0000 (21:05 +0100)
src/epggrab.h
src/epggrab/otamux.c

index 518dcb4ca5ef39aa19dc7609f0bd8ec64e94c84c..352e90ad78cbf7d4d928583eafb1298c96859542 100644 (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?
 
index 310d87eca5b165a2a2fa228f56c9dd6839c3986f..0caa6079c33d61ac3a80b0952beb7ea3c9c434b4 100644 (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;