*/
uint8_t mi_running; /* threads running */
- uint8_t mi_live; /* stream is live */
time_t mi_last_dispatch;
/* Data input */
/* Deliver first TS packets as fast as possible */
mi->mi_last_dispatch = 0;
- /* Wait for first TS packet */
- mi->mi_live = 0;
/* Arm timer */
if (LIST_FIRST(&mi->mi_mux_active) == NULL)
mpegts_mux_t *mm = mpkt->mp_mux;
mpegts_mux_instance_t *mmi;
mpegts_pid_t *last_mp = NULL;
+ th_subscription_t *ths;
#if ENABLE_TSDEBUG
off_t tsdebug_pos;
#endif
if (mm == NULL || (mmi = mm->mm_active) == NULL)
return;
+ LIST_FOREACH(ths, &mmi->mmi_subs, ths_mmi_link)
+ ths->ths_live = 1;
+
assert(mm == mmi->mmi_mux);
#if ENABLE_TSDEBUG
tsdebug_pos = mm->mm_tsdebug_pos;
#endif
- mi->mi_live = 1;
/* Process */
assert((len % 188) == 0);
#if ENABLE_TRACE
char buf[256];
mpegts_mux_nice_name(mm, buf, sizeof(buf));
- tvhtrace("mpegts", "%s - remove subscriber", buf);
+ tvhtrace("mpegts", "%s - remove subscriber (reason %i)", buf, reason);
#endif
subscription_unlink_mux(s, reason);
mm->mm_stop(mm, 0, reason);
mux_data_timeout ( void *aux )
{
th_subscription_t *s = aux;
- mpegts_input_t *mi = s->ths_mmi->mmi_input;
if (!s->ths_mmi)
return;
- if (!mi->mi_live) {
+ if (!s->ths_live) {
+ tvhwarn("subscription", "%04X: mux data timeout for %s", shortid(s), s->ths_title);
mpegts_mux_remove_subscriber(s->ths_mmi->mmi_mux, s, SM_CODE_NO_INPUT);
return;
}
- mi->mi_live = 0;
+ s->ths_live = 0;
if (s->ths_timeout > 0)
gtimer_arm(&s->ths_receive_timer, mux_data_timeout, s, s->ths_timeout);
LIST_ENTRY(th_subscription) ths_mmi_link;
struct mpegts_mux_instance *ths_mmi;
gtimer_t ths_receive_timer;
+ uint8_t ths_live;
#endif
} th_subscription_t;