diff --git a/src/audio/android/SDL_androidaudio.c b/src/audio/android/SDL_androidaudio.c index fa37bd913..817368680 100644 --- a/src/audio/android/SDL_androidaudio.c +++ b/src/audio/android/SDL_androidaudio.c @@ -148,29 +148,12 @@ AudioBootStrap ANDROIDAUDIO_bootstrap = { void ANDROIDAUDIO_PauseDevices(void) { /* TODO: Handle multiple devices? */ - struct SDL_PrivateAudioData *private; if (audioDevice && audioDevice->hidden) { - private = (struct SDL_PrivateAudioData *)audioDevice->hidden; - if (SDL_AtomicGet(&audioDevice->paused)) { - /* The device is already paused, leave it alone */ - private->resume = SDL_FALSE; - } else { - SDL_LockMutex(audioDevice->mixer_lock); - SDL_AtomicSet(&audioDevice->paused, 1); - private->resume = SDL_TRUE; - } + SDL_LockMutex(audioDevice->mixer_lock); } if (captureDevice && captureDevice->hidden) { - private = (struct SDL_PrivateAudioData *)captureDevice->hidden; - if (SDL_AtomicGet(&captureDevice->paused)) { - /* The device is already paused, leave it alone */ - private->resume = SDL_FALSE; - } else { - SDL_LockMutex(captureDevice->mixer_lock); - SDL_AtomicSet(&captureDevice->paused, 1); - private->resume = SDL_TRUE; - } + SDL_LockMutex(captureDevice->mixer_lock); } } @@ -178,23 +161,12 @@ void ANDROIDAUDIO_PauseDevices(void) void ANDROIDAUDIO_ResumeDevices(void) { /* TODO: Handle multiple devices? */ - struct SDL_PrivateAudioData *private; if (audioDevice && audioDevice->hidden) { - private = (struct SDL_PrivateAudioData *)audioDevice->hidden; - if (private->resume) { - SDL_AtomicSet(&audioDevice->paused, 0); - private->resume = SDL_FALSE; - SDL_UnlockMutex(audioDevice->mixer_lock); - } + SDL_UnlockMutex(audioDevice->mixer_lock); } if (captureDevice && captureDevice->hidden) { - private = (struct SDL_PrivateAudioData *)captureDevice->hidden; - if (private->resume) { - SDL_AtomicSet(&captureDevice->paused, 0); - private->resume = SDL_FALSE; - SDL_UnlockMutex(captureDevice->mixer_lock); - } + SDL_UnlockMutex(captureDevice->mixer_lock); } } diff --git a/src/audio/android/SDL_androidaudio.h b/src/audio/android/SDL_androidaudio.h index b28d6f346..4e9df10f1 100644 --- a/src/audio/android/SDL_androidaudio.h +++ b/src/audio/android/SDL_androidaudio.h @@ -30,8 +30,7 @@ struct SDL_PrivateAudioData { - /* Resume device if it was paused automatically */ - int resume; + int unused; }; void ANDROIDAUDIO_ResumeDevices(void);