Fix order of events in case audio buffer size changes
(cherry picked from commit a4ec0b1531)
This commit is contained in:
1 parent
2e43a69a5c
commit
0251b14be3
1 file changed
+2
-2
@@ -700,8 +700,6 @@ static int SDLCALL SDL_RunAudio(void *userdata)
|
|||||||
|
|
||||||
/* Loop, filling the audio buffers */
|
/* Loop, filling the audio buffers */
|
||||||
while (!SDL_AtomicGet(&device->shutdown)) {
|
while (!SDL_AtomicGet(&device->shutdown)) {
|
||||||
data_len = device->callbackspec.size;
|
|
||||||
|
|
||||||
/* Fill the current buffer with sound */
|
/* Fill the current buffer with sound */
|
||||||
if (!device->stream && SDL_AtomicGet(&device->enabled)) {
|
if (!device->stream && SDL_AtomicGet(&device->enabled)) {
|
||||||
data = current_audio.impl.GetDeviceBuf(device);
|
data = current_audio.impl.GetDeviceBuf(device);
|
||||||
@@ -728,6 +726,8 @@ static int SDLCALL SDL_RunAudio(void *userdata)
|
|||||||
data = device->work_buffer;
|
data = device->work_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_len = device->callbackspec.size;
|
||||||
|
|
||||||
/* !!! FIXME: this should be LockDevice. */
|
/* !!! FIXME: this should be LockDevice. */
|
||||||
SDL_LockMutex(device->mixer_lock);
|
SDL_LockMutex(device->mixer_lock);
|
||||||
if (SDL_AtomicGet(&device->paused)) {
|
if (SDL_AtomicGet(&device->paused)) {
|
||||||
|
|||||||
Reference in new issue
Block a user