descrambler: prefcapid_lock - add constants to increase source readability
This commit is contained in:
parent
a50f74c9aa
commit
a2491ffcd7
3 changed files with 11 additions and 7 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue