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:
parent
2b8200aa30
commit
46b3ba2631
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user