aaudio: We need a mixbuf on capture devices, too.

This commit is contained in:
Ryan C. Gordon
2023-07-30 20:24:27 -04:00
parent b0edd23c00
commit 87eae9a0a1
+4 -6
View File
@@ -260,13 +260,11 @@ static int AAUDIO_OpenDevice(SDL_AudioDevice *device)
SDL_UpdatedAudioDeviceFormat(device);
// Allocate mixing buffer
if (!iscapture) {
hidden->mixbuf = (Uint8 *)SDL_malloc(device->buffer_size);
if (hidden->mixbuf == NULL) {
return SDL_OutOfMemory();
}
SDL_memset(hidden->mixbuf, device->silence_value, device->buffer_size);
hidden->mixbuf = (Uint8 *)SDL_malloc(device->buffer_size);
if (hidden->mixbuf == NULL) {
return SDL_OutOfMemory();
}
SDL_memset(hidden->mixbuf, device->silence_value, device->buffer_size);
hidden->semaphore = SDL_CreateSemaphore(0);
if (!hidden->semaphore) {