]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
avahi/bonjour: fix thinkos and typos
authorJaroslav Kysela <perex@perex.cz>
Wed, 29 Nov 2017 09:56:46 +0000 (10:56 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 29 Nov 2017 09:56:46 +0000 (10:56 +0100)
src/avahi.c
src/bonjour.c

index 2b65cf10101951d2e3fa9436364e27022450ad23..55e111de73645f360edf3e27cba159c351769b9a 100644 (file)
@@ -65,7 +65,7 @@ static void create_services(AvahiClient *c);
 static inline int
 avahi_required(void)
 {
-  return http_webui_port > 0 || tvheadend_htsp_port > 0;
+  return tvheadend_webui_port > 0 || tvheadend_htsp_port > 0;
 }
 
 static void
index e6e48315e6f8d7aba1ce7b576d4a52cc888f90e2..3ca25bfed68aeaafb869055a289ccc79afafde1f 100644 (file)
@@ -33,12 +33,6 @@ typedef struct {
 pthread_t bonjour_tid;
 CFNetServiceRef svc_http, svc_htsp;
 
-static inline int
-bonjour_required(void)
-{
-  return http_webui_port > 0 || tvheadend_htsp_port > 0;
-}
-
 static void
 bonjour_callback(CFNetServiceRef theService, CFStreamError* error, void* info)
 {  
@@ -114,19 +108,19 @@ bonjour_init(void)
     { .key = NULL }
   };
 
-  if (!bonjour_required())
-    return;
-  bonjour_start_service(&svc_http, "_http._tcp", tvheadend_webui_port, 
-                        txt_rec_http);
+  if (tvheadend_webui_port > 0)
+    bonjour_start_service(&svc_http, "_http._tcp", tvheadend_webui_port,
+                          txt_rec_http);
 
-  bonjour_start_service(&svc_htsp, "_htsp._tcp", tvheadend_htsp_port, NULL);
+  if (tvheadend_htsp_port > 0)
+    bonjour_start_service(&svc_htsp, "_htsp._tcp", tvheadend_htsp_port, NULL);
 }
 
 void
 bonjour_done(void)
 {
-  if (!bonjour_required())
-    return;
-  bonjour_stop_service(&svc_http);
-  bonjour_stop_service(&svc_htsp);
+  if (tvheadend_webui_port > 0)
+    bonjour_stop_service(&svc_http);
+  if (tvheadend_htsp_port > 0)
+    bonjour_stop_service(&svc_htsp);
 }