audio: Made some SDL_AudioDevice fields atomic.

This makes sure they're properly communicated to the audio threads.
This commit is contained in:
Ryan C. Gordon
2016-08-02 13:48:52 -04:00
parent b35b9f950e
commit 6d5c9c1e67
11 changed files with 38 additions and 38 deletions

View File

@@ -63,12 +63,10 @@ HandleAudioProcess(_THIS)
int bytes = SDL_AUDIO_BITSIZE(this->spec.format) / 8;
int bytes_in = SDL_AUDIO_BITSIZE(this->convert.src_format) / 8;
/* Only do soemthing if audio is enabled */
if (!this->enabled)
return;
if (this->paused)
/* Only do something if audio is enabled */
if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) {
return;
}
if (this->convert.needed) {
if (this->hidden->conv_in_len != 0) {