pthread_mutex_unlock(&capmt->capmt_mutex);
}
+static void
+capmt_caid_add(capmt_service_t *ct, mpegts_service_t *t, int pid, caid_t *c)
+{
+ capmt_caid_ecm_t *cce;
+
+ tvhlog(LOG_DEBUG, "capmt",
+ "%s: New caid 0x%04X:0x%06X (pid 0x%04X) for service \"%s\"",
+ capmt_name(ct->ct_capmt), c->caid, c->providerid, pid, t->s_dvb_svcname);
+
+ cce = calloc(1, sizeof(capmt_caid_ecm_t));
+ cce->cce_caid = c->caid;
+ cce->cce_ecmpid = pid;
+ cce->cce_providerid = c->providerid;
+ cce->cce_service = t;
+ LIST_INSERT_HEAD(&ct->ct_caid_ecm, cce, cce_link);
+ ct->ct_constcw |= c->caid == 0x2600 ? 1 : 0;
+}
+
static void
capmt_caid_change(th_descrambler_t *td)
{
break;
if (cce)
continue;
- tvhlog(LOG_DEBUG, "capmt",
- "%s: New caid 0x%04X:0x%06X for service \"%s\"",
- capmt_name(capmt), c->caid, c->providerid, t->s_dvb_svcname);
-
- /* ecmpid not already seen, add it to list */
- cce = calloc(1, sizeof(capmt_caid_ecm_t));
- cce->cce_caid = c->caid;
- cce->cce_ecmpid = st->es_pid;
- cce->cce_providerid = c->providerid;
- cce->cce_service = t;
- LIST_INSERT_HEAD(&ct->ct_caid_ecm, cce, cce_link);
- ct->ct_constcw |= c->caid == 0x2600 ? 1 : 0;
+ capmt_caid_add(ct, t, st->es_pid, c);
change = 1;
}
}
{
capmt_t *capmt = (capmt_t *)cac;
capmt_service_t *ct;
- capmt_caid_ecm_t *cce;
th_descrambler_t *td;
mpegts_service_t *t = (mpegts_service_t*)s;
elementary_stream_t *st;
continue;
if (t->s_dvb_forcecaid && t->s_dvb_forcecaid != c->caid)
continue;
-
- tvhlog(LOG_DEBUG, "capmt",
- "%s: New caid 0x%04X for service \"%s\"", capmt_name(capmt), c->caid, t->s_dvb_svcname);
-
- /* add it to list */
- cce = calloc(1, sizeof(capmt_caid_ecm_t));
- cce->cce_caid = c->caid;
- cce->cce_ecmpid = st->es_pid;
- cce->cce_providerid = c->providerid;
- cce->cce_service = t;
- LIST_INSERT_HEAD(&ct->ct_caid_ecm, cce, cce_link);
- ct->ct_constcw |= c->caid == 0x2600 ? 1 : 0;
+ capmt_caid_add(ct, t, st->es_pid, c);
change = 1;
}
}
+ if (!change && t->s_dvb_forcecaid) {
+ caid_t sca;
+ memset(&sca, 0, sizeof(sca));
+ sca.caid = t->s_dvb_forcecaid;
+ capmt_caid_add(ct, t, 8191, &sca);
+ change = 1;
+ }
+
td = (th_descrambler_t *)ct;
snprintf(buf, sizeof(buf), "capmt-%s-%i",
capmt->capmt_sockfile,