|
@@ -861,7 +861,7 @@ static void report_emms(struct ts *ts, time_t now) {
|
861
|
861
|
}
|
862
|
862
|
|
863
|
863
|
static void report_ecms(struct ts *ts, time_t now) {
|
864
|
|
- if (ts->stream_is_not_scrambled && ts->ecm_seen_count == 0)
|
|
864
|
+ if ((ts->stream_is_not_scrambled || !ts->have_valid_pmt) && ts->ecm_seen_count == 0)
|
865
|
865
|
return;
|
866
|
866
|
ts_LOGf("ECM | Received %u (%u dup) and processed %u in %lu seconds.\n",
|
867
|
867
|
ts->ecm_seen_count,
|
|
@@ -875,7 +875,7 @@ static void report_ecms(struct ts *ts, time_t now) {
|
875
|
875
|
}
|
876
|
876
|
|
877
|
877
|
static void report_cw_warn(struct ts *ts, time_t now) {
|
878
|
|
- if (ts->stream_is_not_scrambled)
|
|
878
|
+ if (ts->stream_is_not_scrambled || !ts->have_valid_pmt)
|
879
|
879
|
return;
|
880
|
880
|
if (now - ts->key.ts > 1) {
|
881
|
881
|
notify(ts, "NO_CODE_WORD", "No valid code word was received in %ld sec.",
|
|
@@ -919,6 +919,15 @@ static void do_reports(struct ts *ts) {
|
919
|
919
|
report_cw_warn(ts, now);
|
920
|
920
|
}
|
921
|
921
|
}
|
|
922
|
+ if (!ts->no_input) {
|
|
923
|
+ if (ts->last_pmt_ts <= now - 3) {
|
|
924
|
+ if (ts->have_valid_pmt) {
|
|
925
|
+ ts_LOGf("MIS | There is no valid PMT in the input.\n");
|
|
926
|
+ notify(ts, "NO_PROGRAM", "The input is missing valid program.");
|
|
927
|
+ ts->have_valid_pmt = 0;
|
|
928
|
+ }
|
|
929
|
+ }
|
|
930
|
+ }
|
922
|
931
|
}
|
923
|
932
|
|
924
|
933
|
static struct ts ts;
|
|
@@ -1051,6 +1060,7 @@ int main(int argc, char **argv) {
|
1051
|
1060
|
ts.rtp_input ? "rtp" : "udp",
|
1052
|
1061
|
ts.input.hostname, ts.input.service);
|
1053
|
1062
|
}
|
|
1063
|
+ ts.no_input = 1;
|
1054
|
1064
|
ntimeouts++;
|
1055
|
1065
|
} else {
|
1056
|
1066
|
if (ntimeouts && readen > 0) {
|
|
@@ -1060,6 +1070,7 @@ int main(int argc, char **argv) {
|
1060
|
1070
|
ts.rtp_input ? "rtp" : "udp",
|
1061
|
1071
|
ts.input.hostname, ts.input.service,
|
1062
|
1072
|
(now - timeout_start) + 2); // Timeout is detected when ~2 seconds there is no incoming data
|
|
1073
|
+ ts.no_input = 0;
|
1063
|
1074
|
ntimeouts = 0;
|
1064
|
1075
|
}
|
1065
|
1076
|
}
|