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

Commit 204045b2 authored by Haynes Mathew George's avatar Haynes Mathew George
Browse files

audio: fix member initialization

Re-apply missing mutex and condition var initialization
code from I7018f38f29a19b130185b285f4acf22219e4228c.

Change-Id: If1d6b3d4f65c30154d3d6c9e0192a1ce72c0d495
CRs-Fixed: 587676
parent 3c306111
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2807,6 +2807,9 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        return -ENOMEM;
    }

    pthread_mutex_init(&out->lock, (const pthread_mutexattr_t *) NULL);
    pthread_cond_init(&out->cond, (const pthread_condattr_t *) NULL);

    if (devices == AUDIO_DEVICE_NONE)
        devices = AUDIO_DEVICE_OUT_SPEAKER;

@@ -3078,9 +3081,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
    /* out->muted = false; by calloc() */
    /* out->written = 0; by calloc() */

    pthread_mutex_init(&out->lock, (const pthread_mutexattr_t *) NULL);
    pthread_cond_init(&out->cond, (const pthread_condattr_t *) NULL);

    config->format = out->stream.common.get_format(&out->stream.common);
    config->channel_mask = out->stream.common.get_channels(&out->stream.common);
    config->sample_rate = out->stream.common.get_sample_rate(&out->stream.common);