aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-02 00:08:56 -0800
committerChris Robinson <[email protected]>2012-03-02 00:08:56 -0800
commit153affac12bbacdb6c75e5bde708c9ac034d62a2 (patch)
tree2865c6422e25d6b52e530d5beed6512dce0d42be /Alc
parente5d365a3d9642723c2e68660321a6f3e147a7117 (diff)
Recalculate the new update size using the device's UpdateSize
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/pulseaudio.c5
1 files 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,