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

Commit 4cdd524c authored by Chaithanya Krishna Bacharaju's avatar Chaithanya Krishna Bacharaju Committed by Garmond Leung
Browse files

hal: Reset FFV handle to null in deinit

FFV stream init is calling stream deinit as FFV handle is
non-NULL due to previously assigned value.Reset FFV handle
to null in deinit to avoid such issues.

Change-Id: I23200b52d4ba081d391dccfc9f195c3b308a1577
parent eb487888
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -548,6 +548,7 @@ int32_t audio_extn_ffv_stream_deinit()
    if (ffvmod.buffers_allocated)
        deallocate_buffers();

    ffvmod.handle = NULL;
    ffvmod.in = NULL;
    ALOGV("%s: exit", __func__);
    return 0;
@@ -614,6 +615,9 @@ int audio_extn_ffv_init_ec_ref_loopback(struct audio_device *adev,
        goto exit;
    }

    ALOGV("%s: Opening PCM device card_id(%d) device_id(%d), channels %d format %d",
          __func__, adev->snd_card, ffvmod.ec_ref_pcm_id, ffvmod.ec_ref_config.channels,
          ffvmod.ec_ref_config.format);
    ffvmod.ec_ref_pcm = pcm_open(adev->snd_card,
                             ffvmod.ec_ref_pcm_id,
                             PCM_IN, &ffvmod.ec_ref_config);
@@ -623,6 +627,7 @@ int audio_extn_ffv_init_ec_ref_loopback(struct audio_device *adev,
        goto exit;
    }

    ALOGV("%s: pcm_prepare", __func__);
    if (pcm_prepare(ffvmod.ec_ref_pcm) < 0) {
        ALOGE("%s: pcm prepare for ec ref loopback failed", __func__);
        ret = -EINVAL;