commit | 5b5e0c4552e71ba522b429d5a9e8756b7e72db60 | [log] [tgz] |
---|---|---|
author | jiabin <jiabin@google.com> | Tue May 16 23:20:17 2023 +0000 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Thu May 25 21:31:20 2023 +0000 |
tree | 8c013069e7442e5c4e240b876dccf71f6de28ee2 | |
parent | c8fbb82f0820e13ba8f22583c27c977a13b0b02b [diff] |
Use requested sample rate when it matches device sample rate. For input stream, the sample rate should be set as requested one if it matches the device sample rate and is valid. Bug: 282816698 Test: TH (cherry picked from https://android-review.googlesource.com/q/commit:abf24d3cc770f04b7ece1986fd51ce5db742a811) Merged-In: Iebee2b269062609ff7bcd460f48714ca64980e68 Change-Id: Iebee2b269062609ff7bcd460f48714ca64980e68
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c index 43f8d24..d77f7ec 100644 --- a/modules/usbaudio/audio_hal.c +++ b/modules/usbaudio/audio_hal.c
@@ -1510,6 +1510,8 @@ ret = 0; } } + } else if (profile_is_sample_rate_valid(&device_info->profile, config->sample_rate)) { + in->config.rate = config->sample_rate; } } else if (profile_is_sample_rate_valid(&device_info->profile, config->sample_rate)) { in->config.rate = config->sample_rate;