AudioServer: Use NumericLimits<T>

This commit is contained in:
Andreas Kling 2020-04-15 16:52:14 +02:00
parent b517670fc9
commit bdc753ebd2
Notes: sideshowbarker 2024-07-19 07:34:29 +09:00

View file

@ -25,9 +25,9 @@
*/
#include <AK/BufferStream.h>
#include <AK/NumericLimits.h>
#include <AudioServer/ASClientConnection.h>
#include <AudioServer/ASMixer.h>
#include <limits>
#include <pthread.h>
ASMixer::ASMixer()
@ -114,11 +114,11 @@ void ASMixer::mix()
mixed_sample.clip();
i16 out_sample;
out_sample = mixed_sample.left * std::numeric_limits<i16>::max();
out_sample = mixed_sample.left * NumericLimits<i16>::max();
stream << out_sample;
ASSERT(!stream.at_end()); // we should have enough space for both channels in one buffer!
out_sample = mixed_sample.right * std::numeric_limits<i16>::max();
out_sample = mixed_sample.right * NumericLimits<i16>::max();
stream << out_sample;
}
}