]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP server: send valid signal / snr values for IPTV muxes
authorJaroslav Kysela <perex@perex.cz>
Sun, 29 Nov 2015 19:42:28 +0000 (20:42 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 29 Nov 2015 19:42:28 +0000 (20:42 +0100)
src/satip/rtp.c
src/satip/rtsp.c
src/satip/server.h

index 40769b4b1e921d2967e4b84a61b3afb407c4e8ba..19b71a01222ef981e1c7ca6cdf3cc44e27d0686b 100644 (file)
@@ -353,7 +353,7 @@ void satip_rtp_queue(void *id, th_subscription_t *subs,
                      struct sockaddr_storage *peer, int port,
                      int fd_rtp, int fd_rtcp,
                      int frontend, int source, dvb_mux_conf_t *dmc,
-                     mpegts_apids_t *pids)
+                     mpegts_apids_t *pids, int perm_lock)
 {
   satip_rtp_session_t *rtp = calloc(1, sizeof(*rtp));
 
@@ -387,6 +387,13 @@ void satip_rtp_queue(void *id, th_subscription_t *subs,
     socket_set_dscp(rtp->fd_rtcp, IPTOS_DSCP_EF, NULL, 0);
   }
 
+  if (perm_lock) {
+    rtp->sig.signal_scale = SIGNAL_STATUS_SCALE_RELATIVE;
+    rtp->sig.signal = 0xa000;
+    rtp->sig.snr_scale = SIGNAL_STATUS_SCALE_RELATIVE;
+    rtp->sig.snr = 28000;
+  }
+
   pthread_mutex_lock(&satip_rtp_lock);
   TAILQ_INSERT_TAIL(&satip_rtp_sessions, rtp, link);
   tvhthread_create(&rtp->tid, NULL, satip_rtp_thread, rtp, "satip-rtp");
index 8dd68bbcd0e818441a76653bc3ae14315d993a00..88cc3afefed47e22c554cbaeefdef0a4492fd2e3 100644 (file)
@@ -50,6 +50,7 @@ typedef struct session {
   int src;
   int state;
   int shutdown_on_close;
+  int perm_lock;
   uint32_t nsession;
   char session[9];
   dvb_mux_conf_t dmc;
@@ -501,6 +502,7 @@ rtsp_start
                                      MPEGTS_ONID_NONE, MPEGTS_TSID_NONE);
           if (mux) {
             dmc = ((dvb_mux_t *)mux)->lm_tuning;
+            rs->perm_lock = 0;
             break;
           }
         }
@@ -511,6 +513,7 @@ rtsp_start
             break;
         if (mux) {
           dmc = rs->dmc;
+          rs->perm_lock = 1;
           break;
         }
       }
@@ -524,8 +527,10 @@ rtsp_start
         mn2->mn_create_mux(mn2, (void *)(intptr_t)rs->nsession,
                            MPEGTS_ONID_NONE, MPEGTS_TSID_NONE,
                            &rs->dmc, 1);
-      if (mux)
+      if (mux) {
         created = 1;
+        rs->perm_lock = 1;
+      }
     }
     if (mux == NULL) {
       dvb_mux_conf_str(&rs->dmc, buf, sizeof(buf));
@@ -577,7 +582,7 @@ pids:
                     hc->hc_peer, rs->rtp_peer_port,
                     rs->udp_rtp->fd, rs->udp_rtcp->fd,
                     rs->frontend, rs->findex, &rs->dmc_tuned,
-                    &rs->pids);
+                    &rs->pids, rs->perm_lock);
     if (!rs->pids.all && rs->pids.count == 0)
       mpegts_pid_add(&rs->pids, 0, MPS_WEIGHT_RAW);
     svc = (mpegts_service_t *)rs->subs->ths_raw_service;
index 2221c17b955421eb2c5e56fd4071f7950923559c..c30a1ff58f5222aceede4ef70ef94cf3c877c311 100644 (file)
@@ -62,7 +62,7 @@ void satip_rtp_queue(void *id, th_subscription_t *subs,
                      int fd_rtp, int fd_rtcp,
                      int frontend, int source,
                      dvb_mux_conf_t *dmc,
-                     mpegts_apids_t *pids);
+                     mpegts_apids_t *pids, int perm_lock);
 void satip_rtp_update(void *id, th_subscription_t *subs,
                       streaming_queue_t *sq,
                       int frontend, int source,