htsmsg_add_u32(conf, "sid", in->in_service_id);
htsmsg_add_u32(conf, "dvb_servicetype", 1); /* SDTV */
ms = iptv_service_create0(im, 0, 0, NULL, conf);
+ ms->s_pmt_pid = SERVICE_PMT_AUTO;
htsmsg_destroy(conf);
if (ms)
iptv_bouquet_trigger(in, 0);
pthread_mutex_lock(&s->s_stream_mutex);
if (s->s_type == STYPE_STD) {
+ if (s->s_pmt_pid == SERVICE_PMT_AUTO)
+ goto no_pids;
+
mpegts_input_open_pid(mi, mm, s->s_pmt_pid, MPS_SERVICE, MPS_WEIGHT_PMT, s, reopen);
mpegts_input_open_pid(mi, mm, s->s_pcr_pid, MPS_SERVICE, MPS_WEIGHT_PCR, s, reopen);
if (s->s_scrambled_pass)
}
}
+no_pids:
pthread_mutex_unlock(&s->s_stream_mutex);
pthread_mutex_unlock(&mi->mi_output_lock);
pthread_mutex_lock(&s->s_stream_mutex);
if (s->s_type == STYPE_STD) {
+ if (s->s_pmt_pid == SERVICE_PMT_AUTO)
+ goto no_pids;
+
mpegts_input_close_pid(mi, mm, s->s_pmt_pid, MPS_SERVICE, MPS_WEIGHT_PMT, s);
mpegts_input_close_pid(mi, mm, s->s_pcr_pid, MPS_SERVICE, MPS_WEIGHT_PCR, s);
if (s->s_scrambled_pass)
mpegts_input_close_pids(mi, mm, s, 1);
}
+no_pids:
pthread_mutex_unlock(&s->s_stream_mutex);
pthread_mutex_unlock(&mi->mi_output_lock);
int flags, int weight )
{
/* invalid PMT */
- if (t->s_pmt_pid <= 0 || t->s_pmt_pid >= 8191)
+ if (t->s_pmt_pid != SERVICE_PMT_AUTO &&
+ (t->s_pmt_pid <= 0 || t->s_pmt_pid >= 8191))
return SM_CODE_INVALID_SERVICE;
return mpegts_service_enlist_raw(t, ti, sil, flags, weight);
lock_assert(&s->s_stream_mutex);
+ if (s->s_pmt_pid == SERVICE_PMT_AUTO)
+ return;
+
pids = mpegts_pid_alloc();
mpegts_pid_add(pids, s->s_pmt_pid, MPS_WEIGHT_PMT);