From 342fd1486c1b288c738776ac0e912498a18e0ff3 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 7 Jan 2024 18:27:56 +0100 Subject: [PATCH] Increase buffering level smoothness The buffering level does not change continuously: it increases abruptly when a packet is received, and decreases abruptly when an audio block is consumed. To estimate the buffering level, a rolling average is used. To make the buffering more stable, increase the smoothness of this rolling average. This decreases the risk of enabling audio compensation due to an estimation error. --- app/src/audio_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/audio_player.c b/app/src/audio_player.c index 9dc97f58..819fa2da 100644 --- a/app/src/audio_player.c +++ b/app/src/audio_player.c @@ -417,7 +417,7 @@ sc_audio_player_frame_sink_open(struct sc_frame_sink *sink, // Samples are produced and consumed by blocks, so the buffering must be // smoothed to get a relatively stable value. - sc_average_init(&ap->avg_buffering, 32); + sc_average_init(&ap->avg_buffering, 128); ap->samples_since_resync = 0; ap->received = false;