From 858a3f11c6399b690f1aff49791565a766c6d0f0 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 29 Nov 2015 20:42:28 +0100 Subject: [PATCH] SAT>IP server: send valid signal / snr values for IPTV muxes --- src/satip/rtp.c | 9 ++++++++- src/satip/rtsp.c | 9 +++++++-- src/satip/server.h | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/satip/rtp.c b/src/satip/rtp.c index 40769b4b1..19b71a012 100644 --- a/src/satip/rtp.c +++ b/src/satip/rtp.c @@ -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"); diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 8dd68bbcd..88cc3afef 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -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; diff --git a/src/satip/server.h b/src/satip/server.h index 2221c17b9..c30a1ff58 100644 --- a/src/satip/server.h +++ b/src/satip/server.h @@ -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, -- 2.47.3