From: Jaroslav Kysela Date: Wed, 30 Mar 2016 08:05:37 +0000 (+0200) Subject: cwc: fix emm exclusive updates (wrong condition) X-Git-Tag: v4.2.1~776 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17dc2b976f21f1104a5fe9c55d1f0c243284fd53;p=thirdparty%2Ftvheadend.git cwc: fix emm exclusive updates (wrong condition) --- diff --git a/src/descrambler/cwc.c b/src/descrambler/cwc.c index 444143022..cdc50acba 100644 --- a/src/descrambler/cwc.c +++ b/src/descrambler/cwc.c @@ -220,9 +220,9 @@ typedef struct cwc { /* Emm forwarding */ int cwc_forward_emm; - /* one update id */ - int64_t cwc_update_time; - void *cwc_mux; + /* Emm exclusive update */ + int64_t cwc_emm_update_time; + void *cwc_emm_mux; /* From configuration */ @@ -1316,13 +1316,13 @@ cwc_emm(void *opaque, int pid, const uint8_t *data, int len, int emm) mux = pcard->cwc_mux; if (pcard->running && cwc->cwc_forward_emm && cwc->cwc_writer_running) { if (cwc->cwc_emmex) { - if (cwc->cwc_mux != mux) { - if (cwc->cwc_update_time + sec2mono(25) < mclk()) + if (cwc->cwc_emm_mux && cwc->cwc_emm_mux != mux) { + if (cwc->cwc_emm_update_time + sec2mono(25) > mclk()) goto end_of_job; } - cwc->cwc_update_time = mclk(); + cwc->cwc_emm_update_time = mclk(); } - cwc->cwc_mux = mux; + cwc->cwc_emm_mux = mux; emm_filter(&pcard->cs_ra, data, len, mux, cwc_emm_send, pcard); } end_of_job: