Browse Source

Report how much time the input was missing

Georgi Chorbadzhiyski 7 years ago
parent
commit
87494a0ffb
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      tsdecrypt.c

+ 3
- 1
tsdecrypt.c View File

1054
 				ntimeouts++;
1054
 				ntimeouts++;
1055
 			} else {
1055
 			} else {
1056
 				if (ntimeouts && readen > 0) {
1056
 				if (ntimeouts && readen > 0) {
1057
+					time_t now = time(NULL);
1058
+					ts_LOGf("+++ | Input OK after %ld sec timeout.\n", (now - timeout_start) + 2);
1057
 					notify(&ts, "INPUT_OK", "Data is available on input %s://%s:%s/ after %ld seconds timeout.",
1059
 					notify(&ts, "INPUT_OK", "Data is available on input %s://%s:%s/ after %ld seconds timeout.",
1058
 							ts.rtp_input ? "rtp" : "udp",
1060
 							ts.rtp_input ? "rtp" : "udp",
1059
 							ts.input.hostname, ts.input.service,
1061
 							ts.input.hostname, ts.input.service,
1060
-							(time(NULL) - timeout_start) + 2); // Timeout is detected when ~2 seconds there is no incoming data
1062
+							(now - timeout_start) + 2); // Timeout is detected when ~2 seconds there is no incoming data
1061
 					ntimeouts = 0;
1063
 					ntimeouts = 0;
1062
 				}
1064
 				}
1063
 			}
1065
 			}

Loading…
Cancel
Save