Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -2086,7 +2086,14 @@ audio_io_handle_t AudioPolicyManager::selectOutput(const SortedVector<audio_io_h // sampling rate match if (samplingRate > SAMPLE_RATE_HZ_DEFAULT) { currentMatchCriteria[4] = outputDesc->getSamplingRate(); int diff; // avoid unsigned integer overflow. __builtin_sub_overflow(outputDesc->getSamplingRate(), samplingRate, &diff); // prefer the closest output sampling rate greater than or equal to target // if none exists, prefer the closest output sampling rate less than target. // // criteria is offset to make non-negative. currentMatchCriteria[4] = diff >= 0 ? -diff + 200'000'000 : diff + 100'000'000; } // performance flags match Loading Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -2086,7 +2086,14 @@ audio_io_handle_t AudioPolicyManager::selectOutput(const SortedVector<audio_io_h // sampling rate match if (samplingRate > SAMPLE_RATE_HZ_DEFAULT) { currentMatchCriteria[4] = outputDesc->getSamplingRate(); int diff; // avoid unsigned integer overflow. __builtin_sub_overflow(outputDesc->getSamplingRate(), samplingRate, &diff); // prefer the closest output sampling rate greater than or equal to target // if none exists, prefer the closest output sampling rate less than target. // // criteria is offset to make non-negative. currentMatchCriteria[4] = diff >= 0 ? -diff + 200'000'000 : diff + 100'000'000; } // performance flags match Loading