From: Flole Date: Thu, 14 Feb 2019 19:50:24 +0000 (+0100) Subject: Prevent rebinding when refreshing SAT-IP Server settings and not changing port, fixes... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6edc4dab9138cac99f10c42b1dfc0fc475743c46;p=thirdparty%2Ftvheadend.git Prevent rebinding when refreshing SAT-IP Server settings and not changing port, fixes #5539 --- diff --git a/src/satip/server.c b/src/satip/server.c index 63baf4383..72c31493b 100644 --- a/src/satip/server.c +++ b/src/satip/server.c @@ -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 tvh_mutex_t satip_server_reinit; +static int bound_port; static void satip_server_save(void); @@ -556,7 +557,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; } @@ -995,6 +996,7 @@ static void satip_server_init_common(const char *prefix, int announce) nat_ip = strdup(satip_server_conf.satip_nat_ip ?: ""); nat_port = satip_server_conf.satip_nat_rtsp ?: satip_server_rtsp_port; rtp_src_ip = strdup(satip_server_conf.satip_rtp_src_ip ?: ""); + bound_port = satip_server_rtsp_port; if (announce) tvh_mutex_unlock(&global_lock);