[Summary] If Float values are compared as difference, module of this difference should be taken

[Reviewed by] YPozdnyakov
This commit is contained in:
GZharun 2015-05-07 14:55:00 +03:00
parent 0964672cd9
commit ed993ce23a
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ void WavesAudioBackend::AudioDeviceManagerNotification (NotificationReason reaso
std::cout << "------------------------------- WCMRAudioDeviceManagerClient::RequestResync" << std::endl;
break;
case WCMRAudioDeviceManagerClient::SamplingRateChanged:
std::cout << "------------------------------- WCMRAudioDeviceManagerClient::SamplingRateChanged: " << *(int*)parameter << std::endl;
std::cout << "------------------------------- WCMRAudioDeviceManagerClient::SamplingRateChanged: " << *(float*)parameter << std::endl;
_sample_rate_change(*(float*)parameter);
break;
case WCMRAudioDeviceManagerClient::Dropout:

View file

@ -1006,7 +1006,7 @@ WTErr WCMRCoreAudioDevice::SetAndCheckCurrentSamplingRate (int newRate)
bool found = false;
for(int i = 0; gAllSampleRates[i] > 0; i++)
{
if (gAllSampleRates[i] - actualSamplingRate < 0.01) {
if (fabs(gAllSampleRates[i] - actualSamplingRate) < 0.01) {
found = true;
}
}