|
@@ -127,9 +127,9 @@ static void show_help(struct ts *ts) {
|
127
|
127
|
printf(" -E --emm-only | Send only EMMs to CAMD, skipping ECMs and without\n");
|
128
|
128
|
printf(" . decoding the input stream.\n");
|
129
|
129
|
printf(" -Z --emm-pid <pid> | Force EMM pid. Default: none\n");
|
130
|
|
- printf(" -f --emm-report-time <sec> | Report how much EMMs has been send for processing\n");
|
131
|
|
- printf(" . each <sec> seconds. Set <sec> to 0 to disable\n");
|
132
|
|
- printf(" . reporting. Default: %d sec\n", ts->camd35.emm_count_report_interval);
|
|
130
|
+ printf(" -f --emm-report-time <sec> | Report each <sec> seconds how much EMMs have been\n");
|
|
131
|
+ printf(" . received/processed. Set <sec> to 0 to disable\n");
|
|
132
|
+ printf(" . the reports. Default: %d sec\n", ts->emm_report_interval);
|
133
|
133
|
printf("\n");
|
134
|
134
|
printf("ECM options:\n");
|
135
|
135
|
printf(" -X --ecm-pid <pid> | Force ECM pid. Default: none\n");
|
|
@@ -276,11 +276,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
276
|
276
|
ts->emm_send = 1;
|
277
|
277
|
break;
|
278
|
278
|
case 'f':
|
279
|
|
- ts->camd35.emm_count_report_interval = atoi(optarg);
|
280
|
|
- if (ts->camd35.emm_count_report_interval < 0)
|
281
|
|
- ts->camd35.emm_count_report_interval = 0;
|
282
|
|
- if (ts->camd35.emm_count_report_interval > 86400)
|
283
|
|
- ts->camd35.emm_count_report_interval = 86400;
|
|
279
|
+ ts->emm_report_interval = strtoul(optarg, NULL, 10);
|
|
280
|
+ if (ts->emm_report_interval > 86400)
|
|
281
|
+ ts->emm_report_interval = 86400;
|
284
|
282
|
break;
|
285
|
283
|
|
286
|
284
|
case 'X':
|
|
@@ -367,9 +365,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
367
|
365
|
ts_LOGf("Pkt sleep : %d us (%d ms)\n", ts->packet_delay, ts->packet_delay / 1000);
|
368
|
366
|
ts_LOGf("TS discont : %s\n", ts->ts_discont ? "report" : "ignore");
|
369
|
367
|
ts->threaded = !(ts->input.type == FILE_IO && ts->input.fd != 0);
|
370
|
|
- if (ts->emm_send && ts->camd35.emm_count_report_interval)
|
371
|
|
- ts_LOGf("EMM report : %d sec\n", ts->camd35.emm_count_report_interval);
|
372
|
|
- if (ts->emm_send && ts->camd35.emm_count_report_interval == 0)
|
|
368
|
+ if (ts->emm_send && ts->emm_report_interval)
|
|
369
|
+ ts_LOGf("EMM report : %d sec\n", ts->emm_report_interval);
|
|
370
|
+ if (ts->emm_send && ts->emm_report_interval == 0)
|
373
|
371
|
ts_LOGf("EMM report : disabled\n");
|
374
|
372
|
if (ts->emm_only) {
|
375
|
373
|
ts_LOGf("EMM only : %s\n", ts->emm_only ? "yes" : "no");
|
|
@@ -389,6 +387,21 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
389
|
387
|
}
|
390
|
388
|
}
|
391
|
389
|
|
|
390
|
+static void do_reports(struct ts *ts) {
|
|
391
|
+ time_t now = time(NULL);
|
|
392
|
+ if (ts->emm_send && ts->emm_report_interval) {
|
|
393
|
+ if ((time_t)(ts->emm_last_report + ts->emm_report_interval) <= now) {
|
|
394
|
+ ts->emm_last_report = now;
|
|
395
|
+ ts_LOGf("EMM | Received %u and processed %u in %u seconds.\n",
|
|
396
|
+ ts->emm_seen_count,
|
|
397
|
+ ts->emm_processed_count,
|
|
398
|
+ ts->emm_report_interval);
|
|
399
|
+ ts->emm_seen_count = 0;
|
|
400
|
+ ts->emm_processed_count = 0;
|
|
401
|
+ }
|
|
402
|
+ }
|
|
403
|
+}
|
|
404
|
+
|
392
|
405
|
void signal_quit(int sig) {
|
393
|
406
|
if (!keep_running)
|
394
|
407
|
raise(sig);
|
|
@@ -444,6 +457,8 @@ int main(int argc, char **argv) {
|
444
|
457
|
|
445
|
458
|
camd_start(&ts);
|
446
|
459
|
do {
|
|
460
|
+ do_reports(&ts);
|
|
461
|
+
|
447
|
462
|
if (ts.input.type == NET_IO) {
|
448
|
463
|
set_log_io_errors(0);
|
449
|
464
|
if (!ts.rtp_input) {
|