|
@@ -73,6 +73,7 @@ static const struct option long_options[] = {
|
73
|
73
|
{ "emm-report-time", required_argument, NULL, 'f' },
|
74
|
74
|
|
75
|
75
|
{ "ecm-pid", required_argument, NULL, 'X' },
|
|
76
|
+ { "ecm-report-time", required_argument, NULL, 'H' },
|
76
|
77
|
{ "ecm-irdeto-type", required_argument, NULL, 'G' },
|
77
|
78
|
{ "ecm-no-log", no_argument , NULL, 'K' },
|
78
|
79
|
|
|
@@ -133,6 +134,9 @@ static void show_help(struct ts *ts) {
|
133
|
134
|
printf("\n");
|
134
|
135
|
printf("ECM options:\n");
|
135
|
136
|
printf(" -X --ecm-pid <pid> | Force ECM pid. Default: none\n");
|
|
137
|
+ printf(" -H --ecm-report-time <sec> | Report each <sec> how much ECMs and CWs have been\n");
|
|
138
|
+ printf(" . processed/skipped. Set <sec> to 0 to disable\n");
|
|
139
|
+ printf(" . the reports. Default: %d sec\n", ts->ecm_report_interval);
|
136
|
140
|
printf(" -G --ecm-irdeto-type <int> | Process IRDETO ECMs with type X /0..3/. Default: %d\n", ts->irdeto_ecm);
|
137
|
141
|
printf(" -K --ecm-no-log | Disable ECM and code words logging.\n");
|
138
|
142
|
printf("\n");
|
|
@@ -284,6 +288,11 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
284
|
288
|
case 'X':
|
285
|
289
|
ts->forced_ecm_pid = strtoul(optarg, NULL, 0) & 0x1fff;
|
286
|
290
|
break;
|
|
291
|
+ case 'H':
|
|
292
|
+ ts->ecm_report_interval = strtoul(optarg, NULL, 10);
|
|
293
|
+ if (ts->ecm_report_interval > 86400)
|
|
294
|
+ ts->ecm_report_interval = 86400;
|
|
295
|
+ break;
|
287
|
296
|
case 'G':
|
288
|
297
|
ts->irdeto_ecm = atoi(optarg);
|
289
|
298
|
break;
|
|
@@ -375,6 +384,10 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
375
|
384
|
ts_LOGf("EMM send : %s\n", ts->emm_send ? "enabled" : "disabled");
|
376
|
385
|
ts_LOGf("Decoding : %s\n", ts->threaded ? "threaded" : "single thread");
|
377
|
386
|
}
|
|
387
|
+ if (!ts->emm_only && ts->ecm_report_interval)
|
|
388
|
+ ts_LOGf("ECM report : %d sec\n", ts->emm_report_interval);
|
|
389
|
+ if (!ts->emm_only && ts->ecm_report_interval == 0)
|
|
390
|
+ ts_LOGf("ECM report : disabled\n");
|
378
|
391
|
|
379
|
392
|
if (!ts->ecm_cw_log)
|
380
|
393
|
ts_LOGf("ECM/CW log : disabled\n");
|
|
@@ -400,6 +413,19 @@ static void do_reports(struct ts *ts) {
|
400
|
413
|
ts->emm_processed_count = 0;
|
401
|
414
|
}
|
402
|
415
|
}
|
|
416
|
+ if (!ts->emm_only && ts->ecm_report_interval) {
|
|
417
|
+ if ((time_t)(ts->ecm_last_report + ts->ecm_report_interval) <= now) {
|
|
418
|
+ ts->ecm_last_report = now;
|
|
419
|
+ ts_LOGf("ECM | Received %u (%u dup) and processed %u in %u seconds.\n",
|
|
420
|
+ ts->ecm_seen_count,
|
|
421
|
+ ts->ecm_duplicate_count,
|
|
422
|
+ ts->ecm_processed_count,
|
|
423
|
+ ts->ecm_report_interval);
|
|
424
|
+ ts->ecm_seen_count = 0;
|
|
425
|
+ ts->ecm_duplicate_count = 0;
|
|
426
|
+ ts->ecm_processed_count = 0;
|
|
427
|
+ }
|
|
428
|
+ }
|
403
|
429
|
}
|
404
|
430
|
|
405
|
431
|
void signal_quit(int sig) {
|