aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/sndio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-23 15:42:16 -0700
committerChris Robinson <[email protected]>2011-06-23 15:42:16 -0700
commite42bdc202266c69dc6bc82044e44b14be1ce9c49 (patch)
tree4a1dc4cfe68a0819ac79778282c9983a799f3dda /Alc/sndio.c
parentcf44f499b8a1e8535b95f419111ea466207c8d6e (diff)
Fix device Update parameters for sndio
Diffstat (limited to 'Alc/sndio.c')
-rw-r--r--Alc/sndio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/sndio.c b/Alc/sndio.c
index 3b4d4316..6ee49519 100644
--- a/Alc/sndio.c
+++ b/Alc/sndio.c
@@ -240,7 +240,8 @@ static ALCboolean sndio_reset_playback(ALCdevice *device)
par.le = SIO_LE_NATIVE;
par.round = device->UpdateSize;
- par.appbufsz = device->UpdateSize * device->NumUpdates;
+ par.appbufsz = device->UpdateSize * (device->NumUpdates-1);
+ if(!par.appbufsz) par.appbufsz = device->UpdateSize;
if(!sio_setpar(data->sndHandle, &par) || !sio_getpar(data->sndHandle, &par))
@@ -292,7 +293,7 @@ static ALCboolean sndio_reset_playback(ALCdevice *device)
device->UpdateSize = par.round;
- device->NumUpdates = (par.appbufsz+par.round-1) / par.round;
+ device->NumUpdates = (par.bufsz/par.round) + 1;
SetDefaultChannelOrder(device);