Add code for calculating and recognising the interpolation threshold.

This commit is contained in:
Mike Brady
2019-01-04 17:10:26 +00:00
parent 01dbf625fe
commit 7b97ea4019
+6 -2
View File
@@ -1491,7 +1491,7 @@ void *player_thread_func(void *arg) {
conn->first_packet_timestamp = 0;
conn->flush_requested = 0;
conn->fix_volume = 0x10000;
if (conn->latency == 0) {
debug(3, "No latency has (yet) been specified. Setting 88,200 (2 seconds) frames "
"as a default.");
@@ -1551,6 +1551,10 @@ void *player_thread_func(void *arg) {
debug(3, "Output frame bytes is %d.", conn->output_bytes_per_frame);
conn->dac_buffer_queue_minimum_length = (int64_t)(config.audio_backend_buffer_interpolation_threshold_in_seconds *
config.output_rate);
debug(1,"dac_buffer_queue_minimum_length is %" PRId64 " frames.", conn->dac_buffer_queue_minimum_length);
conn->session_corrections = 0;
// conn->play_segment_reference_frame = 0; // zero signals that we are not in a play segment
@@ -2214,7 +2218,7 @@ void *player_thread_func(void *arg) {
}
}
if ((current_delay < (DAC_BUFFER_QUEUE_MINIMUM_LENGTH * conn->output_sample_ratio)) ||
if ((current_delay < conn->dac_buffer_queue_minimum_length) ||
(config.packet_stuffing == ST_basic)) {
play_samples =
stuff_buffer_basic_32((int32_t *)conn->tbuf, inbuflength, config.output_format,