]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP server cleanups, fixes #4252
authorJaroslav Kysela <perex@perex.cz>
Mon, 27 Feb 2017 16:32:20 +0000 (17:32 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 27 Feb 2017 16:32:20 +0000 (17:32 +0100)
src/satip/rtsp.c
src/satip/server.c

index c9d8d9523a5b46e46bf4475e57fcb63d076f0e08..e061bdf23f30ea3177beaed14a685f80fbb1fec4 100644 (file)
@@ -1683,7 +1683,7 @@ void satip_server_rtsp_done(void)
   rtsp_port = -1;
   free(rtsp_ip);
   free(rtsp_nat_ip);
-  rtsp_ip = NULL;
+  rtsp_ip = rtsp_nat_ip = NULL;
   satip_rtp_done();
   pthread_mutex_unlock(&global_lock);
 }
index e0bf95c8a940b72037f14e233deaaf4a1b3a6828..4259405eef78b0ad70b06d247e294e50f1463e02 100644 (file)
@@ -529,6 +529,10 @@ static void satip_server_info(const char *prefix, int descramble, int muxcnf)
   int fe, findex;
   const char *ftype;
 
+  if (satip_server_rtsp_port <= 0) {
+    tvhinfo(LS_SATIPS, "SAT>IP Server inactive");
+    return;
+  }
   tvhinfo(LS_SATIPS, "SAT>IP Server %sinitialized", prefix);
   tvhinfo(LS_SATIPS, "  HTTP %s:%d, RTSP %s:%d",
               http_server_ip, http_server_port,
@@ -761,6 +765,9 @@ static void satip_server_init_common(const char *prefix, int announce)
   int descramble, rewrite_pmt, muxcnf;
   char *nat_ip;
 
+  if (satip_server_rtsp_port <= 0)
+    return;
+
   if (http_server_ip == NULL) {
     if (tcp_server_onall(http_server) && satip_server_bindaddr == NULL) {
       tvherror(LS_SATIPS, "use --satip_bindaddr parameter to select the local IP for SAT>IP");
@@ -775,9 +782,6 @@ static void satip_server_init_common(const char *prefix, int announce)
     http_server_port = ntohs(IP_PORT(http));
   }
 
-  if (satip_server_rtsp_port <= 0)
-    return;
-
   descramble = satip_server_conf.satip_descramble;
   rewrite_pmt = satip_server_conf.satip_rewrite_pmt;
   muxcnf = satip_server_conf.satip_muxcnf;