Merge "AHAL: use PCM_FORMAT_INVALID as the termination of format array."

This commit is contained in:
Treehugger Robot 2023-04-13 16:56:20 +00:00 committed by Gerrit Code Review
commit d10869b255

View file

@ -132,7 +132,7 @@ ndk::ScopedAStatus ModuleUsb::populateConnectedDevicePort(AudioPort* audioPort)
std::vector<int> sampleRates = populateSampleRatesFromProfile(&profile);
for (size_t i = 0; i < std::min(MAX_PROFILE_FORMATS, AUDIO_PORT_MAX_AUDIO_PROFILES) &&
profile.formats[i] != 0;
profile.formats[i] != PCM_FORMAT_INVALID;
++i) {
auto audioFormatDescription =
usb::legacy2aidl_pcm_format_AudioFormatDescription(profile.formats[i]);