Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cwc: small optimization - prefcapid handling in cwc_table_input
  • Loading branch information
perexg committed Feb 21, 2015
1 parent ab25868 commit 19422a4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/descrambler/cwc.c
Expand Up @@ -1652,17 +1652,12 @@ cwc_table_input(void *opaque, int pid, const uint8_t *data, int len)
}
}

if(t->s_dvb_prefcapid == pid) {
if(t->s_dvb_prefcapid == pid || t->s_dvb_prefcapid == 0) {
ep = calloc(1, sizeof(ecm_pid_t));
ep->ep_pid = t->s_dvb_prefcapid;
ep->ep_pid = pid;
LIST_INSERT_HEAD(&ct->cs_pids, ep, ep_link);
tvhlog(LOG_DEBUG, "cwc", "Insert prefered ECM (PID %d) for service \"%s\"", t->s_dvb_prefcapid, t->s_dvb_svcname);
}
else if(t->s_dvb_prefcapid == 0) {
ep = calloc(1, sizeof(ecm_pid_t));
ep->ep_pid = pid;
LIST_INSERT_HEAD(&ct->cs_pids, ep, ep_link);
tvhlog(LOG_DEBUG, "cwc", "Insert new ECM (PID %d) for service \"%s\"", pid, t->s_dvb_svcname);
tvhlog(LOG_DEBUG, "cwc", "Insert %s ECM (PID %d) for service \"%s\"",
t->s_dvb_prefcapid ? "preferred" : "new", pid, t->s_dvb_svcname);
}
}
}
Expand Down

0 comments on commit 19422a4

Please sign in to comment.