|
@@ -12,6 +12,8 @@
|
12
|
12
|
* GNU General Public License (COPYING file) for more details.
|
13
|
13
|
*
|
14
|
14
|
*/
|
|
15
|
+#include <string.h>
|
|
16
|
+
|
15
|
17
|
#include "data.h"
|
16
|
18
|
#include "tables.h"
|
17
|
19
|
#include "camd.h"
|
|
@@ -173,6 +175,11 @@ void process_pmt(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
|
173
|
175
|
} else {
|
174
|
176
|
ts_LOGf("*** | ERROR: Can't detect ECM pid.\n");
|
175
|
177
|
}
|
|
178
|
+
|
|
179
|
+ if (ts->req_CA_sys == CA_IRDETO) {
|
|
180
|
+ memset(ts->irdeto_chid, 0, sizeof(ts->irdeto_chid));
|
|
181
|
+ ts->irdeto_max_chids = 0;
|
|
182
|
+ }
|
176
|
183
|
}
|
177
|
184
|
|
178
|
185
|
static int sdt_parse_service_name_desc(
|
|
@@ -315,12 +322,26 @@ static void __process_ecm(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
|
315
|
322
|
|
316
|
323
|
if (ts->req_CA_sys == CA_IRDETO) {
|
317
|
324
|
uint8_t idx = ts->ecm->section_header->section_data[4];
|
|
325
|
+ uint8_t max_idx = ts->ecm->section_header->section_data[5];
|
318
|
326
|
uint16_t chid = (ts->ecm->section_header->section_data[6] << 8) | ts->ecm->section_header->section_data[7];
|
319
|
327
|
|
|
328
|
+ if (max_idx != ts->irdeto_max_chids) {
|
|
329
|
+ memset(ts->irdeto_chid, 0, sizeof(ts->irdeto_chid));
|
|
330
|
+ ts->irdeto_max_chids = max_idx;
|
|
331
|
+ }
|
|
332
|
+
|
320
|
333
|
bool ecm_ok = false;
|
|
334
|
+ const char *filter_type;
|
321
|
335
|
switch (ts->irdeto_ecm_filter_type) {
|
322
|
|
- case IRDETO_FILTER_IDX : ecm_ok = (idx == ts->irdeto_ecm_idx); break;
|
323
|
|
- case IRDETO_FILTER_CHID: ecm_ok = (chid == ts->irdeto_ecm_chid); break;
|
|
336
|
+ case IRDETO_FILTER_IDX : ecm_ok = (idx == ts->irdeto_ecm_idx); filter_type = " BY IDX"; break;
|
|
337
|
+ case IRDETO_FILTER_CHID: ecm_ok = (chid == ts->irdeto_ecm_chid); filter_type = " BY CHID"; break;
|
|
338
|
+ }
|
|
339
|
+
|
|
340
|
+ if (ts->irdeto_chid[idx].seen < 1) {
|
|
341
|
+ ts_LOGf("CAS | Seen Irdeto CHID 0x%04x (idx %u/%u)%s%s\n", chid, idx, max_idx,
|
|
342
|
+ ecm_ok ? " *SELECTED*" : "",
|
|
343
|
+ ecm_ok ? filter_type : "");
|
|
344
|
+ ts->irdeto_chid[idx].seen++;
|
324
|
345
|
}
|
325
|
346
|
|
326
|
347
|
if (!ecm_ok) {
|