]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip server: allow to configure the signal level for IPTV streams, fixes #4448
authorJaroslav Kysela <perex@perex.cz>
Tue, 20 Jun 2017 08:48:04 +0000 (10:48 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 6 Jul 2017 13:23:28 +0000 (15:23 +0200)
src/satip/rtp.c
src/satip/server.c
src/satip/server.h

index f2911128a7960bc65756efbfc4ab57ce38a0cd34..68aa5c936641f42f6eacbf550a95568342861adc 100644 (file)
@@ -490,10 +490,11 @@ void satip_rtp_queue(void *id, th_subscription_t *subs,
     socket_set_dscp(rtp->fd_rtcp, dscp, NULL, 0);
 
   if (perm_lock) {
+    int tmp = ((satip_server_conf.satip_iptv_sig_level * 0xffff) + 0x8000) / 245;
     rtp->sig.signal_scale = SIGNAL_STATUS_SCALE_RELATIVE;
-    rtp->sig.signal = 0xa000;
+    rtp->sig.signal = MINMAX(tmp, 0, 0xffff);
     rtp->sig.snr_scale = SIGNAL_STATUS_SCALE_RELATIVE;
-    rtp->sig.snr = 28000;
+    rtp->sig.snr = MAX(0xffff, (rtp->sig.signal * 3) / 2);
   }
 
   tvhtrace(LS_SATIPS, "rtp queue %p", rtp);
index 512eef6c887ef95e735188286bf11f0d421f1ffd..88f06b4d05fa6aadd42aa9f5e593f46ef3a6cf46 100644 (file)
@@ -572,7 +572,8 @@ struct satip_server_conf satip_server_conf = {
   .idnode.in_class = &satip_server_class,
   .satip_descramble = 1,
   .satip_weight = 100,
-  .satip_allow_remote_weight = 1
+  .satip_allow_remote_weight = 1,
+  .satip_iptv_sig_level = 220,
 };
 
 static void satip_server_class_changed(idnode_t *self)
@@ -706,6 +707,16 @@ const idclass_t satip_server_class = {
       .opts   = PO_EXPERT,
       .group  = 1,
     },
+    {
+      .type   = PT_U32,
+      .id     = "satip_iptv_sig_level",
+      .name   = N_("IPTV signal level"),
+      .desc   = N_("Signal level for IPTV sources (0-240)."),
+      .off    = offsetof(struct satip_server_conf, satip_iptv_sig_level),
+      .opts   = PO_EXPERT,
+      .group  = 1,
+      .def.i  = 220,
+    },
     {
       .type   = PT_INT,
       .id     = "satip_dvbs",
index 9aa9ebdf869f7f9ba1ee073adfd35eb2e561182d..fd07c59fb07e69d66205a74c1b2c21847aa11ea5 100644 (file)
@@ -47,6 +47,7 @@ struct satip_server_conf {
   int satip_rewrite_pmt;
   int satip_muxcnf;
   int satip_nom3u;
+  int satip_iptv_sig_level;
   int satip_dvbs;
   int satip_dvbs2;
   int satip_dvbt;