From 153affac12bbacdb6c75e5bde708c9ac034d62a2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 2 Mar 2012 00:08:56 -0800 Subject: Recalculate the new update size using the device's UpdateSize --- Alc/backends/pulseaudio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 80fdea55..4eecfdfe 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -1054,13 +1054,12 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{ data->spec = *(pa_stream_get_sample_spec(data->stream)); if(device->Frequency != data->spec.rate) { - size_t frame_size = pa_frame_size(&data->spec); pa_operation *o; /* Server updated our playback rate, so modify the buffer attribs * accordingly. */ - data->attr.minreq = (ALuint64)(data->attr.minreq/frame_size) * - data->spec.rate / device->Frequency * frame_size; + data->attr.minreq = (ALuint64)device->UpdateSize * data->spec.rate / + device->Frequency * pa_frame_size(&data->spec); data->attr.tlength = data->attr.minreq * maxu(device->NumUpdates, 2); o = pa_stream_set_buffer_attr(data->stream, &data->attr, -- cgit v1.2.3