Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d06c8e7 authored by Narsinga Rao Chella's avatar Narsinga Rao Chella Committed by Gerrit - the friendly Code Review server
Browse files

hal: fix to handle voip issue when input stream starts first

- adev_open_output_stream() fails if the use case is already enabled.
Because of this, in case of VoIP, when the input stream is created
and started before creating Audio Track, then the output stream
creation fails.

- Fix this issue by giving exception for VoIP use case.

Change-Id: I5e7329d64075a09b99e5760a9050ace8c62a4e87
CRs-fixed: 651761
parent a593da0c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2224,7 +2224,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev,

    /* Check if this usecase is already existing */
    pthread_mutex_lock(&adev->lock);
    if (get_usecase_from_list(adev, out->usecase) != NULL) {
    if ((get_usecase_from_list(adev, out->usecase) != NULL) &&
        (out->usecase != USECASE_COMPRESS_VOIP_CALL)) {
        ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase);
        pthread_mutex_unlock(&adev->lock);
        ret = -EEXIST;