Make resend error backoff work better and set it to 0.5 seconds. Quieten some routine debug messages.

This commit is contained in:
Mike Brady
2018-04-23 13:09:44 +01:00
parent d80ca712d2
commit 41241681e3
3 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -430,7 +430,7 @@ void *dacp_monitor_thread_code(__attribute__((unused)) void *na) {
else
idle_scan_count = 0;
debug(2, "Scan Result: %d, Bad Scan Count: %d, Idle Scan Count: %d.", result, bad_result_count,
debug(3, "Scan Result: %d, Bad Scan Count: %d, Idle Scan Count: %d.", result, bad_result_count,
idle_scan_count);
if ((bad_result_count == config.scan_max_bad_response_count) ||
+1 -1
View File
@@ -527,7 +527,7 @@ void player_put_packet(seq_t seqno, uint32_t actual_timestamp, int64_t timestamp
check_buf->resend_level = j;
if (config.disable_resend_requests == 0) {
rtp_request_resend(next, 1, conn);
if (j >= 3)
if (j >= 6)
debug(2, "Resend request level #%d for packet %u in range %u to %u.", j, next,
conn->ab_read, conn->ab_write);
conn->resend_requests++;
+7 -4
View File
@@ -969,8 +969,8 @@ void rtp_request_resend(seq_t first, uint32_t count, rtsp_conn_info *conn) {
}
#endif
uint64_t time_of_sending_fp = get_absolute_time_in_fp();
uint64_t resend_error_backoff_time = (uint64_t)10 << 32; // ten seconds
if ((conn->rtp_time_of_last_resend_request_error_fp) ||
uint64_t resend_error_backoff_time = (uint64_t)1 << (32-1); // half a second
if ((conn->rtp_time_of_last_resend_request_error_fp==0) ||
((time_of_sending_fp - conn->rtp_time_of_last_resend_request_error_fp) >
resend_error_backoff_time)) {
if ((config.diagnostic_drop_packet_fraction == 0.0) ||
@@ -979,14 +979,17 @@ void rtp_request_resend(seq_t first, uint32_t count, rtsp_conn_info *conn) {
(struct sockaddr *)&conn->rtp_client_control_socket, msgsize) == -1) {
char em[1024];
strerror_r(errno, em, sizeof(em));
debug(1, "Error %d using send-to to an audio socket: \"%s\". ", errno, em);
debug(1, "Error %d using send-to to an audio socket: \"%s\". Backing off for 0.5 seconds.", errno, em);
conn->rtp_time_of_last_resend_request_error_fp = time_of_sending_fp;
} else {
conn->rtp_time_of_last_resend_request_error_fp = 0;
}
} else {
debug(3, "Dropping resend request packet to simulate a bad network.");
debug(3, "Dropping resend request packet to simulate a bad network. Backing off for 0.5 seconds.");
conn->rtp_time_of_last_resend_request_error_fp = time_of_sending_fp;
}
} else {
debug(3,"Backing off sending resend requests due to a previous send-to error");
}
} else {
// if (!request_sent) {