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.

PR #4572 <https://github.com/Genymobile/scrcpy/pull/4572>
audio_player_atomic.16
Romain Vimont 5 months ago
parent 44abed5c68
commit edac4b8a9a

@ -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;

Loading…
Cancel
Save