audio: Fix audio stream format when binding to a capture device.

Fixes #8402.
main
Ryan C. Gordon 2023-10-16 13:34:15 -04:00
parent f26b838a3e
commit 8c39269279
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 4 additions and 1 deletions

View File

@ -1708,7 +1708,10 @@ int SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int
logdev->bound_streams = stream;
if (iscapture) {
stream->src_spec.format = logdev->postmix ? SDL_AUDIO_F32 : device->spec.format;
SDL_copyp(&stream->src_spec, &device->spec);
if (logdev->postmix) {
stream->src_spec.format = SDL_AUDIO_F32;
}
}
SDL_UnlockMutex(stream->lock);