diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index 8d0bc76b..818ef7a5 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -1664,7 +1664,7 @@ capmt_caid_change(th_descrambler_t *td) lock_assert(&t->s_stream_mutex); TAILQ_FOREACH(st, &t->s_filt_components, es_filt_link) { - if (t->s_dvb_prefcapid_lock == 2 && + if (t->s_dvb_prefcapid_lock == PREFCAPID_FORCE && t->s_dvb_prefcapid != st->es_pid) continue; LIST_FOREACH(c, &st->es_caids, link) { @@ -1954,7 +1954,7 @@ capmt_service_start(caclient_t *cac, service_t *s) TAILQ_FOREACH(st, &t->s_filt_components, es_filt_link) { caid_t *c; - if (t->s_dvb_prefcapid_lock == 2 && + if (t->s_dvb_prefcapid_lock == PREFCAPID_FORCE && t->s_dvb_prefcapid != st->es_pid) continue; LIST_FOREACH(c, &st->es_caids, link) { diff --git a/src/descrambler/cwc.c b/src/descrambler/cwc.c index 80337bb0..091179e4 100644 --- a/src/descrambler/cwc.c +++ b/src/descrambler/cwc.c @@ -769,7 +769,7 @@ forbid: ct->td_keystate = DS_FORBIDDEN; ct->ecm_state = ECM_RESET; /* this pid is not valid, force full scan */ - if (t->s_dvb_prefcapid == ct->cs_channel && t->s_dvb_prefcapid_lock == 0) + if (t->s_dvb_prefcapid == ct->cs_channel && t->s_dvb_prefcapid_lock == PREFCAPID_OFF) t->s_dvb_prefcapid = 0; } return; @@ -782,7 +782,7 @@ forbid: if(t->s_dvb_prefcapid == 0 || (t->s_dvb_prefcapid != ct->cs_channel && - t->s_dvb_prefcapid_lock == 0)) { + t->s_dvb_prefcapid_lock == PREFCAPID_OFF)) { t->s_dvb_prefcapid = ct->cs_channel; tvhlog(LOG_DEBUG, "cwc", "Saving prefered PID %d for %s", t->s_dvb_prefcapid, ct->td_nicename); @@ -1639,7 +1639,7 @@ cwc_table_input(void *opaque, int pid, const uint8_t *data, int len) if (ct->ecm_state == ECM_INIT) { // Validate prefered ECM PID - if(t->s_dvb_prefcapid != 0) { + if(t->s_dvb_prefcapid != PREFCAPID_OFF) { struct elementary_stream *prefca = service_stream_find((service_t*)t, t->s_dvb_prefcapid); if (!prefca || prefca->es_type != SCT_CA) { @@ -1995,7 +1995,7 @@ cwc_service_start(caclient_t *cac, service_t *t) LIST_FOREACH(pcard, &cwc->cwc_cards, cs_card) { if (pcard->cwc_caid == 0) continue; TAILQ_FOREACH(st, &t->s_filt_components, es_filt_link) { - if (((mpegts_service_t *)t)->s_dvb_prefcapid_lock == 2 && + if (((mpegts_service_t *)t)->s_dvb_prefcapid_lock == PREFCAPID_FORCE && ((mpegts_service_t *)t)->s_dvb_prefcapid != st->es_pid) continue; LIST_FOREACH(c, &st->es_caids, link) { diff --git a/src/input/mpegts.h b/src/input/mpegts.h index fc5dcd5d..ef03e9be 100644 --- a/src/input/mpegts.h +++ b/src/input/mpegts.h @@ -450,7 +450,11 @@ struct mpegts_mux TAILQ_HEAD(, tsdebug_packet) mm_tsdebug_packets; #endif }; - + +#define PREFCAPID_OFF 0 +#define PREFCAPID_ON 1 +#define PREFCAPID_FORCE 2 + /* Service */ struct mpegts_service {