diff options
author | Mingshu Pang <mpang@codeaurora.org> | 2019-04-01 09:49:23 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-04-03 01:30:43 -0700 |
commit | d9da833b909525ec85ce623920e088ce777bbf06 (patch) | |
tree | 9daa5dfb14b0cf23ccce41cf80ebe0d2d49f50d5 /hal/audio_extn | |
parent | 2b86010b2d51c43969cbd73a26c15a1d0ee49622 (diff) | |
download | hardware_qcom_audio-d9da833b909525ec85ce623920e088ce777bbf06.tar.gz hardware_qcom_audio-d9da833b909525ec85ce623920e088ce777bbf06.tar.bz2 hardware_qcom_audio-d9da833b909525ec85ce623920e088ce777bbf06.zip |
hal: fix no sound issue when using some USB headset.
The RX bit-width is overwritten when getting the RX and
TX capabilities with same memory.
Use different variables to fix the issue.
CRs-Fixed: 2426606
Change-Id: Ib254eaa3ff3ce04eb77299757ff3cbfaeff9e57a
Diffstat (limited to 'hal/audio_extn')
-rw-r--r-- | hal/audio_extn/usb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hal/audio_extn/usb.c b/hal/audio_extn/usb.c index 278d85ff..a807f031 100644 --- a/hal/audio_extn/usb.c +++ b/hal/audio_extn/usb.c @@ -1137,8 +1137,14 @@ void audio_extn_usb_add_device(audio_devices_t device, int card) usb_card_info->usb_card = card; usb_card_info->usb_device_type = device; usb_get_sidetone_mixer(usb_card_info); - if (!usb_get_device_cap_config(usb_card_info, card)) - usbmod->is_capture_supported = true; + struct usb_card_config *usb_card_info_temp = NULL; + usb_card_info_temp = calloc(1, sizeof(struct usb_card_config)); + if (usb_card_info_temp != NULL) { + list_init(&usb_card_info_temp->usb_device_conf_list); + if (!usb_get_capability(USB_CAPTURE, usb_card_info_temp, card)) + usbmod->is_capture_supported = true; + free(usb_card_info_temp); + } list_add_tail(&usbmod->usb_card_conf_list, &usb_card_info->list); goto exit; } |