diff options
author | Chris Robinson <[email protected]> | 2012-09-20 15:01:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-09-20 15:01:49 -0700 |
commit | 52d403b0d18fa65b976d5e430b9f4c3adc749ac7 (patch) | |
tree | da4da9fcb92cb7c13feeff9559a97fc52733e307 /Alc | |
parent | ccd35bffe7ba6365e194a9332cf73e71412b80cd (diff) |
Make sure PulseAudio sets an update size that's a multiple of 4 samples with SSE
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/pulseaudio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index beae5fac..9512c8af 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -1100,9 +1100,12 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) /* Server updated our playback rate, so modify the buffer attribs * accordingly. */ data->attr.minreq = (ALuint64)device->UpdateSize * data->spec.rate / - device->Frequency * pa_frame_size(&data->spec); + device->Frequency; + if((CPUCapFlags&CPU_CAP_SSE)) + data->attr.minreq = (data->attr.minreq+3)&~3; + data->attr.minreq *= pa_frame_size(&data->spec); data->attr.tlength = data->attr.minreq * maxu(device->NumUpdates, 2); - data->attr.prebuf = 0; + data->attr.prebuf = 0; o = pa_stream_set_buffer_attr(data->stream, &data->attr, stream_success_callback, device); |