Skip to content

Commit

Permalink
Prefer to clip too many samples than too few. Fixes issue 183.
Browse files Browse the repository at this point in the history
  • Loading branch information
jarikomppa committed Nov 13, 2018
1 parent 64d7d0d commit 487c014
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/soloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ namespace SoLoud
{
__m128 vol = _mm_load_ps(volumes.mData);

for (i = 0; i < aSamples / 4; i++)
for (i = 0; i < (aSamples / 4) + 1; i++) // round up
{
//float f1 = origdata[c] * v; c++; v += vd;
__m128 f = _mm_load_ps(&aBuffer.mData[c]);
Expand Down Expand Up @@ -761,7 +761,7 @@ namespace SoLoud
for (j = 0; j < mChannels; j++)
{
__m128 vol = _mm_load_ps(volumes.mData);
for (i = 0; i < aSamples / 4; i++)
for (i = 0; i < (aSamples / 4) + 1; i++) // round up
{
//float f1 = aBuffer.mData[c] * v; c++; v += vd;
__m128 f = _mm_load_ps(&aBuffer.mData[c]);
Expand Down Expand Up @@ -795,7 +795,7 @@ namespace SoLoud
for (j = 0; j < mChannels; j++)
{
v = aVolume0;
for (i = 0; i < aSamples/4; i++)
for (i = 0; i < (aSamples / 4) + 1; i++) // round up
{
float f1 = aBuffer.mData[c] * v; c++; v += vd;
float f2 = aBuffer.mData[c] * v; c++; v += vd;
Expand All @@ -821,7 +821,7 @@ namespace SoLoud
for (j = 0; j < mChannels; j++)
{
v = aVolume0;
for (i = 0; i < aSamples / 4; i++)
for (i = 0; i < (aSamples / 4) + 1; i++) // round up
{
float f1 = aBuffer.mData[c] * v; c++; v += vd;
float f2 = aBuffer.mData[c] * v; c++; v += vd;
Expand Down

0 comments on commit 487c014

Please sign in to comment.