summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiabin <jiabin@google.com>2023-05-16 23:20:17 +0000
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-05-25 21:31:20 +0000
commit5b5e0c4552e71ba522b429d5a9e8756b7e72db60 (patch)
tree8c013069e7442e5c4e240b876dccf71f6de28ee2
parentc8fbb82f0820e13ba8f22583c27c977a13b0b02b (diff)
downloadlibhardware-android14-dev.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.c2
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;