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

Commit 2e947fa1 authored by Nitin Srivastava's avatar Nitin Srivastava Committed by Zhihai Xu
Browse files

Set out stream to null if control socket fails to connect

Set out stream to null if control socket fails to connect.
This helps in avoiding wrong usage of audio device out stream
even after the same is freed as part of control socket connection
failure.

Change-Id: I8e2a7bbc71d581525b7eef1955e411c220d01627
parent e91698e1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -941,6 +941,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
err_open:
    free(out);
    *stream_out = NULL;
    a2dp_dev->output = NULL;
    ERROR("failed");
    return ret;
}
@@ -970,8 +971,10 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
    int retval = 0;

    if (out == NULL)
    {
        ERROR("ERROR: set param called even when stream out is null");
        return retval;

    }
    INFO("state %d", out->state);

    retval = out->stream.common.set_parameters((struct audio_stream *)out, kvpairs);