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

Commit f5b19d1a authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of audio-userspace.lnx.2.1.c1-00013.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1076923   I5fafaa71d13ce234908dc2e24979d69a38435f62   hal: Fix for a native crash in select_devices

Change-Id: Ic7ce6836a5ea6622638f63cb1f35c410f6d361a3
CRs-Fixed: 1076923
parents 57fe3200 a6615103
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1218,6 +1218,10 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
    if ((usecase->type == VOICE_CALL) ||
        (usecase->type == VOIP_CALL)  ||
        (usecase->type == PCM_HFP_CALL)) {
        if(usecase->stream.out == NULL) {
            ALOGE("%s: stream.out is NULL", __func__);
            return -EINVAL;
        }
        out_snd_device = platform_get_output_snd_device(adev->platform,
                                                        usecase->stream.out);
        in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices);
@@ -1261,6 +1265,10 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
            }
        }
        if (usecase->type == PCM_PLAYBACK) {
            if (usecase->stream.out == NULL) {
                ALOGE("%s: stream.out is NULL", __func__);
                return -EINVAL;
            }
            usecase->devices = usecase->stream.out->devices;
            in_snd_device = SND_DEVICE_NONE;
            if (out_snd_device == SND_DEVICE_NONE) {
@@ -1273,6 +1281,10 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
                }
            }
        } else if (usecase->type == PCM_CAPTURE) {
            if (usecase->stream.in == NULL) {
                ALOGE("%s: stream.in is NULL", __func__);
                return -EINVAL;
            }
            usecase->devices = usecase->stream.in->device;
            out_snd_device = SND_DEVICE_NONE;
            if (in_snd_device == SND_DEVICE_NONE) {