1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

remove obsolete if

This commit is contained in:
Nils Fenner 2015-10-29 22:18:52 +01:00
parent 2b8200aa30
commit 46b3ba2631
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C

View File

@ -564,19 +564,16 @@ bool Audio::tryCaptureSamples(int16_t* buf, int samples)
alcCaptureSamples(Audio::alInDev, buf, samples);
if (inputVolume != 1)
for (size_t i = 0; i < samples * AUDIO_CHANNELS; ++i)
{
for (size_t i = 0; i < samples * AUDIO_CHANNELS; ++i)
{
int sample = buf[i] * pow(inputVolume, 2);
int sample = buf[i] * pow(inputVolume, 2);
if (sample < std::numeric_limits<int16_t>::min())
sample = std::numeric_limits<int16_t>::min();
else if (sample > std::numeric_limits<int16_t>::max())
sample = std::numeric_limits<int16_t>::max();
if (sample < std::numeric_limits<int16_t>::min())
sample = std::numeric_limits<int16_t>::min();
else if (sample > std::numeric_limits<int16_t>::max())
sample = std::numeric_limits<int16_t>::max();
buf[i] = sample;
}
buf[i] = sample;
}
return true;