diff options
author | jiabin <jiabin@google.com> | 2023-05-16 23:20:17 +0000 |
---|---|---|
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-05-25 21:31:20 +0000 |
commit | 5b5e0c4552e71ba522b429d5a9e8756b7e72db60 (patch) | |
tree | 8c013069e7442e5c4e240b876dccf71f6de28ee2 | |
parent | c8fbb82f0820e13ba8f22583c27c977a13b0b02b (diff) | |
download | libhardware-5b5e0c4552e71ba522b429d5a9e8756b7e72db60.tar.gz |
Use requested sample rate when it matches device sample rate.android14-dev
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
-rw-r--r-- | modules/usbaudio/audio_hal.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c index 43f8d240..d77f7ec6 100644 --- a/modules/usbaudio/audio_hal.c +++ b/modules/usbaudio/audio_hal.c @@ -1510,6 +1510,8 @@ static int adev_open_input_stream(struct audio_hw_device *hw_dev, 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; |