summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorjiabin <jiabin@google.com>2023-05-16 23:20:17 +0000
committerjiabin <jiabin@google.com>2023-05-16 23:20:17 +0000
commitabf24d3cc770f04b7ece1986fd51ce5db742a811 (patch)
tree6e1926780620e450898986b834f38ca2d45800ad /modules
parente8ab477900c72d9618c26b011736c9a14573cd33 (diff)
downloadlibhardware-abf24d3cc770f04b7ece1986fd51ce5db742a811.tar.gz
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 Change-Id: Iebee2b269062609ff7bcd460f48714ca64980e68
Diffstat (limited to 'modules')
-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 1bd53c27..f21dcd7e 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;