pthread_mutex_t *tcp_lock;
uint8_t *table_data;
int table_data_len;
+ void (*no_data_cb)(void *opaque);
+ void *no_data_opaque;
} satip_rtp_session_t;
static pthread_mutex_t satip_rtp_lock;
break;
case SMT_NOSTART:
case SMT_EXIT:
+ if (rtp->no_data_cb)
+ rtp->no_data_cb(rtp->no_data_opaque);
alive = 0;
break;
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, int allow_data, int perm_lock)
+ mpegts_apids_t *pids, int allow_data, int perm_lock,
+ void (*no_data_cb)(void *opaque),
+ void *no_data_opaque)
{
satip_rtp_session_t *rtp = calloc(1, sizeof(*rtp));
int dscp;
rtp->subs = subs;
rtp->sq = sq;
rtp->tcp_lock = tcp_lock;
+ rtp->no_data_cb = no_data_cb;
+ rtp->no_data_opaque = no_data_opaque;
atomic_set(&rtp->allow_data, allow_data);
mpegts_pid_init(&rtp->pids);
mpegts_pid_copy(&rtp->pids, pids);
http_connection_t *shutdown_on_close;
http_connection_t *tcp_data;
int perm_lock;
+ int no_data;
uint32_t nsession;
char session[9];
dvb_mux_conf_t dmc;
rs->mux_created = 0;
}
+/*
+ *
+ */
+static void
+rtsp_no_data(void *opaque)
+{
+ session_t *rs = opaque;
+ rs->no_data = 1;
+}
+
/*
*
*/
(rtsp_muxcnf == MUXCNF_REJECT || rtsp_muxcnf == MUXCNF_REJECT_EXACT_MATCH ) ? " (configuration)" : "");
goto endclean;
}
- if (rs->mux == mux && rs->subs)
+ if (rs->mux == mux && rs->subs) {
+ if (rs->no_data)
+ goto endclean;
goto pids;
+ }
rtsp_clean(rs);
rs->dmc_tuned = dmc;
rs->mux = mux;
if (cmd != RTSP_CMD_DESCRIBE && rs->state != STATE_PLAY) {
if (rs->mux == NULL)
goto endclean;
+ rs->no_data = 0;
rs->rtp_handle =
satip_rtp_queue(rs->subs, &rs->prch.prch_sq,
&hc->hc_fd_lock, hc->hc_peer, rs->rtp_peer_port,
rs->findex, rs->src, &rs->dmc_tuned,
&rs->pids,
cmd == RTSP_CMD_PLAY || oldstate == STATE_PLAY,
- rs->perm_lock);
+ rs->perm_lock, rtsp_no_data, rs);
if (rs->rtp_handle == NULL) {
res = HTTP_STATUS_INTERNAL;
goto endclean;
int frontend, int source,
dvb_mux_conf_t *dmc,
mpegts_apids_t *pids,
- int allow_data, int perm_lock);
-void satip_rtp_update(void *_rtp, th_subscription_t *subs,
- streaming_queue_t *sq,
- int frontend, int source,
- dvb_mux_conf_t *dmc,
- mpegts_apids_t *pids,
- mpegts_apids_t *pmt_pids);
+ int allow_data, int perm_lock,
+ void (*no_data_cb)(void *opaque),
+ void *no_data_opaque);
void satip_rtp_allow_data(void *_rtp);
void satip_rtp_update_pids(void *_rtp, mpegts_apids_t *pids);
void satip_rtp_update_pmt_pids(void *_rtp, mpegts_apids_t *pmt_pids);