]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tvhdhomerun: only run discovery once upon startup (fixes #2418)
authorBeralt <beralt@beralt.nl>
Tue, 28 Oct 2014 11:10:17 +0000 (12:10 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 28 Oct 2014 20:08:29 +0000 (21:08 +0100)
src/input/mpegts/tvhdhomerun/tvhdhomerun.c

index efd321fcb9bfa5090bc2dfba10d95a208457ac6e..5ee36b63112909422ac4c40b9fe4a8eea38754d3 100644 (file)
@@ -27,8 +27,7 @@
 #include <arpa/inet.h>
 #include <openssl/sha.h>
 
-static void tvhdhomerun_device_discovery_start( void );
-
+static void tvhdhomerun_device_discovery( void );
 
 static void
 tvhdhomerun_device_class_save ( idnode_t *in )
@@ -48,8 +47,6 @@ tvhdhomerun_device_class_get_childs ( idnode_t *in )
   return is;
 }
 
-static gtimer_t tvhdhomerun_discovery_timer;
-
 typedef struct tvhdhomerun_discovery {
   TAILQ_ENTRY(tvhdhomerun_discovery) disc_link; 
 } tvhdhomerun_discovery_t;
@@ -336,7 +333,7 @@ static void tvhdhomerun_device_create(struct hdhomerun_discover_device_t *dInfo)
 }
 
 static void
-tvhdhomerun_discovery_timer_cb(void *aux)
+tvhdhomerun_device_discovery( void )
 {
   struct hdhomerun_discover_device_t result_list[MAX_HDHOMERUN_DEVICES];
 
@@ -362,15 +359,6 @@ tvhdhomerun_discovery_timer_cb(void *aux)
       }
     }  
   }
-
-  // Do rediscovery every 30 seconds..
-  gtimer_arm_ms(&tvhdhomerun_discovery_timer, tvhdhomerun_discovery_timer_cb, NULL, 15*1000); 
-}
-
-static void
-tvhdhomerun_device_discovery_start( void )
-{
-  gtimer_arm(&tvhdhomerun_discovery_timer, tvhdhomerun_discovery_timer_cb, NULL, 1);
 }
 
 void tvhdhomerun_init ( void )
@@ -380,7 +368,7 @@ void tvhdhomerun_init ( void )
   hdhomerun_debug_set_filename(hdhomerun_debug_obj, "/tmp/tvheadend_hdhomerun_errors.log");
   hdhomerun_debug_enable(hdhomerun_debug_obj);
   TAILQ_INIT(&tvhdhomerun_discoveries);
-  tvhdhomerun_device_discovery_start();
+  tvhdhomerun_device_discovery();
 }
 
 void tvhdhomerun_done ( void )
@@ -411,7 +399,6 @@ tvhdhomerun_device_destroy( tvhdhomerun_device_t *hd )
   lock_assert(&global_lock);
 
   gtimer_disarm(&hd->hd_destroy_timer);
-  gtimer_disarm(&tvhdhomerun_discovery_timer);
 
   tvhlog(LOG_INFO, "tvhdhomerun", "Releaseing locks for devices");
   while ((lfe = TAILQ_FIRST(&hd->hd_frontends)) != NULL) {