mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Use PulseAudio fragsize buffer correctly
Fixes broken microphone input in Sober
This commit is contained in:

committed by
Ryan C. Gordon

parent
ec0e4e21c7
commit
a743fb578c
@@ -732,7 +732,7 @@ static bool PULSEAUDIO_OpenDevice(SDL_AudioDevice *device)
|
|||||||
if (!actual_bufattr) {
|
if (!actual_bufattr) {
|
||||||
result = SDL_SetError("Could not determine connected PulseAudio stream's buffer attributes");
|
result = SDL_SetError("Could not determine connected PulseAudio stream's buffer attributes");
|
||||||
} else {
|
} else {
|
||||||
device->buffer_size = (int) recording ? actual_bufattr->tlength : actual_bufattr->fragsize;
|
device->buffer_size = (int) recording ? actual_bufattr->fragsize : actual_bufattr->tlength;
|
||||||
device->sample_frames = device->buffer_size / SDL_AUDIO_FRAMESIZE(device->spec);
|
device->sample_frames = device->buffer_size / SDL_AUDIO_FRAMESIZE(device->spec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user