summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-12-27 15:03:54 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2018-12-27 15:03:54 +0100
commit5e5f62b77f34d8a9c0fdaed1fd5559057c48c077 (patch)
treecbcfb6000a63b2b7dfbf4f0470d198f56f163425
parentb29dcd04cad08902bde5696131906184a440d647 (diff)
Improved clip prevention.
-rw-r--r--src/soundplayer.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/soundplayer.cc b/src/soundplayer.cc
index d24eec5..319b11a 100644
--- a/src/soundplayer.cc
+++ b/src/soundplayer.cc
@@ -92,11 +92,7 @@ void SoundPlayer::run()
goto nextitem;
}
- //while(std::abs(_sf[i] + item.samples[item.pos] * scale) > 1.0)
- //{
- // scale *= 0.999999;
- //}
- scale = 1.0 / active.size();
+ scale = std::min(scale, 1.0 / active.size());
_sf[i] += item.samples[item.pos] * scale;
item.pos++;