summaryrefslogtreecommitdiff
path: root/player.c
diff options
context:
space:
mode:
authorMike Brady <mikebrady@eircom.net>2019-04-16 16:40:56 +0100
committerMike Brady <mikebrady@eircom.net>2019-04-16 16:40:56 +0100
commit9aa8f91c0e8ca4b7c7674ce9bc1623be48beaab0 (patch)
treee331604c09549faebb901aa7324e29c5266a085a /player.c
parentca8acb4a3f2e38d1e04b151870ad4a53d8aa16c5 (diff)
Add a new interpolation setting -- "auto" which will choose soxr if supported and the soxr delay is less or equal to the threshold of 30 (milliseconds).
Diffstat (limited to 'player.c')
-rw-r--r--player.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/player.c b/player.c
index 6f3dc35..c222e00 100644
--- a/player.c
+++ b/player.c
@@ -2282,15 +2282,19 @@ void *player_thread_func(void *arg) {
}
}
+#ifdef CONFIG_SOXR
if ((current_delay < conn->dac_buffer_queue_minimum_length) ||
- (config.packet_stuffing == ST_basic)) {
+ (config.packet_stuffing == ST_basic) ||
+ (config.soxr_delay_index == 0) || // not computed yet
+ ((config.packet_stuffing == ST_auto) && (config.soxr_delay_index > config.soxr_delay_threshold)) // if the CPU is deemed too slow
+ ) {
+#endif
play_samples =
stuff_buffer_basic_32((int32_t *)conn->tbuf, inbuflength, config.output_format,
conn->outbuf, amount_to_stuff, conn->enable_dither, conn);
- }
#ifdef CONFIG_SOXR
- else if (config.packet_stuffing == ST_soxr) {
- // if (amount_to_stuff) debug(1,"Soxr stuff...");
+ }
+ else { // soxr requested or auto requested with the index less or equal to the threshold
play_samples = stuff_buffer_soxr_32((int32_t *)conn->tbuf, (int32_t *)conn->sbuf,
inbuflength, config.output_format, conn->outbuf,
amount_to_stuff, conn->enable_dither, conn);