AudioFileMp3 - fixed clipping issue

AudioFileMp3::rescale was missing a clip boundary on -1 and thus
could have caused artifacts in exported MP3s. Fixed.
This commit is contained in:
Andrew Kelley
2009-07-15 11:42:26 -07:00
parent 2741eb217a
commit 0e2c6762f0

View File

@@ -149,7 +149,7 @@ bool AudioFileMp3::startEncoding( void )
short int AudioFileMp3::rescale(float sample) {
return (qMin<float>(sample, 1) / 1) * std::numeric_limits<short int>::max();
return (qMax<float>(qMin<float>(sample, 1), -1) / 1) * std::numeric_limits<short int>::max();
}
// encode data and write to file