Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SAT>IP server: send valid signal / snr values for IPTV muxes
  • Loading branch information
perexg committed Nov 29, 2015
1 parent 8c5a818 commit 858a3f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/satip/rtp.c
Expand Up @@ -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));

Expand Down Expand Up @@ -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");
Expand Down
9 changes: 7 additions & 2 deletions src/satip/rtsp.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -511,6 +513,7 @@ rtsp_start
break;
if (mux) {
dmc = rs->dmc;
rs->perm_lock = 1;
break;
}
}
Expand All @@ -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));
Expand Down Expand Up @@ -577,7 +582,7 @@ rtsp_start
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;
Expand Down
2 changes: 1 addition & 1 deletion src/satip/server.h
Expand Up @@ -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,
Expand Down

0 comments on commit 858a3f1

Please sign in to comment.