mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 12:45:34 +00:00
coreaudio: If paused, clear any pending stream data.
This makes sure stuff that was still pending for conversion/resampling doesn't pop in later when the device is unpaused again. Fixes #8485.
This commit is contained in:
parent
d5896f9010
commit
9d7feaaf9e
|
@ -532,6 +532,9 @@ static void outputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBuffe
|
||||||
if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) {
|
if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) {
|
||||||
/* Supply silence if audio is not enabled or paused */
|
/* Supply silence if audio is not enabled or paused */
|
||||||
SDL_memset(inBuffer->mAudioData, this->spec.silence, inBuffer->mAudioDataBytesCapacity);
|
SDL_memset(inBuffer->mAudioData, this->spec.silence, inBuffer->mAudioDataBytesCapacity);
|
||||||
|
if (this->stream) {
|
||||||
|
SDL_AudioStreamClear(this->stream);
|
||||||
|
}
|
||||||
} else if (this->stream) {
|
} else if (this->stream) {
|
||||||
UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
|
UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
|
||||||
Uint8 *ptr = (Uint8 *)inBuffer->mAudioData;
|
Uint8 *ptr = (Uint8 *)inBuffer->mAudioData;
|
||||||
|
|
Loading…
Reference in a new issue