diff --git a/src/descrambler/cwc.c b/src/descrambler/cwc.c index ab996433..cd7406e8 100755 --- a/src/descrambler/cwc.c +++ b/src/descrambler/cwc.c @@ -782,7 +782,9 @@ forbid: ct->cs_channel = es->es_channel; ct->ecm_state = ECM_VALID; - if(t->s_dvb_prefcapid == 0 || t->s_dvb_prefcapid != ct->cs_channel) { + if(t->s_dvb_prefcapid == 0 || + (t->s_dvb_prefcapid != ct->cs_channel && + t->s_dvb_prefcapid_lock == 0)) { t->s_dvb_prefcapid = ct->cs_channel; tvhlog(LOG_DEBUG, "cwc", "Saving prefered PID %d for %s", t->s_dvb_prefcapid, ct->td_nicename); diff --git a/src/input/mpegts.h b/src/input/mpegts.h index 292d2527..791e56be 100644 --- a/src/input/mpegts.h +++ b/src/input/mpegts.h @@ -428,6 +428,7 @@ struct mpegts_service uint16_t s_dvb_servicetype; char *s_dvb_charset; uint16_t s_dvb_prefcapid; + int s_dvb_prefcapid_lock; /* * EIT/EPG control diff --git a/src/input/mpegts/mpegts_service.c b/src/input/mpegts/mpegts_service.c index ed41eaf6..f7e53b2d 100644 --- a/src/input/mpegts/mpegts_service.c +++ b/src/input/mpegts/mpegts_service.c @@ -133,6 +133,13 @@ const idclass_t mpegts_service_class = .off = offsetof(mpegts_service_t, s_dvb_prefcapid), .opts = PO_ADVANCED, }, + { + .type = PT_BOOL, + .id = "prefcapid_lock", + .name = "Lock Pref. CA PID", + .off = offsetof(mpegts_service_t, s_dvb_prefcapid_lock), + .opts = PO_ADVANCED, + }, {}, } };