]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Prevent rebinding when refreshing SAT-IP Server settings and not changing port, fixes...
authorFlole <flole@flole.de>
Thu, 14 Feb 2019 19:50:24 +0000 (20:50 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 1 Mar 2019 15:45:02 +0000 (16:45 +0100)
src/satip/server.c

index fac9fc85c46706321e6ff15919e481e3bef1bcec..efabda91a264a7001498c0e4d8c3a712fb1be8ce 100644 (file)
@@ -36,6 +36,7 @@ static int satip_server_rtsp_port;
 static int satip_server_rtsp_port_locked;
 static upnp_service_t *satips_upnp_discovery;
 static pthread_mutex_t satip_server_reinit;
+static int bound_port;
 
 static void satip_server_save(void);
 
@@ -544,7 +545,7 @@ static void satips_rtsp_port(int def)
   int rtsp_port = satip_server_rtsp_port;
   if (!satip_server_rtsp_port_locked)
     rtsp_port = satip_server_conf.satip_rtsp > 0 ? satip_server_conf.satip_rtsp : def;
-  if (getuid() != 0 && rtsp_port > 0 && rtsp_port < 1024) {
+  if (getuid() != 0 && rtsp_port > 0 && rtsp_port < 1024 && bound_port != rtsp_port) {
     tvherror(LS_SATIPS, "RTSP port %d specified but no root perms, using 9983", rtsp_port);
     rtsp_port = 9983;
   }
@@ -924,6 +925,7 @@ static void satip_server_init_common(const char *prefix, int announce)
   muxcnf = satip_server_conf.satip_muxcnf;
   nat_ip = strdup(satip_server_conf.satip_nat_ip ?: "");
   nat_port = satip_server_conf.satip_nat_rtsp ?: satip_server_rtsp_port;
+  bound_port = satip_server_rtsp_port;
 
   if (announce)
     pthread_mutex_unlock(&global_lock);