Do not read avg_buffering from the player thread
On buffer underflow, the average buffering must be updated, but it is intended to be accessed only from the receiver thread. Make the player and the receiver thread communicate the underflow via a new field (ap->underflow).
This commit is contained in:
@@ -56,6 +56,10 @@ struct sc_audio_player {
|
||||
// (only used by the receiver thread)
|
||||
uint32_t samples_since_resync;
|
||||
|
||||
// Number of silence samples inserted since the last received packet
|
||||
// (protected by SDL_AudioDeviceLock())
|
||||
uint32_t underflow;
|
||||
|
||||
// Set to true the first time a sample is received (protected by
|
||||
// SDL_AudioDeviceLock())
|
||||
bool received;
|
||||
|
||||
Reference in New Issue
Block a user