From 2e1f1449bc7bd9f50822298577be203693deca7f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 22 Feb 2017 15:44:47 -0800 Subject: [PATCH] Don't remove a period from the OSS buffer Since we're now waiting for space to be available before mixing, the mixing buffer isn't adding another period. --- Alc/backends/oss.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c index 8934181b..b22e87ba 100644 --- a/Alc/backends/oss.c +++ b/Alc/backends/oss.c @@ -419,17 +419,10 @@ static ALCboolean ALCplaybackOSS_reset(ALCplaybackOSS *self) periods = device->NumUpdates; numChannels = ChannelsFromDevFmt(device->FmtChans); - frameSize = numChannels * BytesFromDevFmt(device->FmtType); - ossSpeed = device->Frequency; - log2FragmentSize = log2i(device->UpdateSize * frameSize); - - /* according to the OSS spec, 16 bytes are the minimum */ - if (log2FragmentSize < 4) - log2FragmentSize = 4; - /* Subtract one period since the temp mixing buffer counts as one. Still - * need at least two on the card, though. */ - if(periods > 2) periods--; + frameSize = numChannels * BytesFromDevFmt(device->FmtType); + /* According to the OSS spec, 16 bytes (log2(16)) is the minimum. */ + log2FragmentSize = maxi(log2i(device->UpdateSize*frameSize), 4); numFragmentsLogSize = (periods << 16) | log2FragmentSize; #define CHECKERR(func) if((func) < 0) { \ @@ -467,7 +460,7 @@ static ALCboolean ALCplaybackOSS_reset(ALCplaybackOSS *self) device->Frequency = ossSpeed; device->UpdateSize = info.fragsize / frameSize; - device->NumUpdates = info.fragments + 1; + device->NumUpdates = info.fragments; SetDefaultChannelOrder(device); -- 2.11.4.GIT