Merge "hal: Update FM record usecase in open input stream." into audio-hal.lnx.6.0

This commit is contained in:
Linux Build Service Account 2019-04-11 22:14:07 -07:00 committed by Gerrit - the friendly Code Review server
commit fd6d3e4fdf
1 changed files with 10 additions and 0 deletions

View File

@ -8043,6 +8043,16 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
in->format = config->format; in->format = config->format;
in->usecase = USECASE_AUDIO_RECORD; in->usecase = USECASE_AUDIO_RECORD;
if (in->source == AUDIO_SOURCE_FM_TUNER) {
if(!get_usecase_from_list(adev, USECASE_AUDIO_RECORD_FM_VIRTUAL))
in->usecase = USECASE_AUDIO_RECORD_FM_VIRTUAL;
else {
ret = -EINVAL;
goto err_open;
}
}
if (config->sample_rate == LOW_LATENCY_CAPTURE_SAMPLE_RATE && if (config->sample_rate == LOW_LATENCY_CAPTURE_SAMPLE_RATE &&
(flags & AUDIO_INPUT_FLAG_FAST) != 0) { (flags & AUDIO_INPUT_FLAG_FAST) != 0) {
is_low_latency = true; is_low_latency = true;