aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-22 15:44:47 -0800
committerChris Robinson <[email protected]>2017-02-22 15:44:47 -0800
commit2e1f1449bc7bd9f50822298577be203693deca7f (patch)
tree871401e8f11269218fc3a2e2ca0696600f2ce34b
parente720faf2d40e9e4ec27479ffbbcba1a3b3838956 (diff)
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.
-rw-r--r--Alc/backends/oss.c15
1 files 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);