From: Jaroslav Kysela Date: Sat, 21 Feb 2015 20:46:23 +0000 (+0100) Subject: cwc: small optimization - prefcapid handling in cwc_table_input X-Git-Tag: v4.1~339 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19422a4d296b8b169f25593eba881739574d17c6;p=thirdparty%2Ftvheadend.git cwc: small optimization - prefcapid handling in cwc_table_input --- diff --git a/src/descrambler/cwc.c b/src/descrambler/cwc.c index dd4b1e1a8..7a8c4001c 100644 --- a/src/descrambler/cwc.c +++ b/src/descrambler/cwc.c @@ -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); } } }