Apply new compensation only if it changed

If the compensation is the same (typically when it is 0), do not reapply
it.
This commit is contained in:
Romain Vimont
2023-03-11 23:00:48 +01:00
parent 73727e7fdf
commit 0bf866fa8d
2 changed files with 13 additions and 4 deletions

View File

@@ -60,6 +60,9 @@ struct sc_audio_player {
// (protected by SDL_AudioDeviceLock())
uint32_t underflow;
// Current applied compensation value (only used by the receiver thread)
int compensation;
// Set to true the first time a sample is received (protected by
// SDL_AudioDeviceLock())
bool received;