audio: fix member initialization
Re-apply missing mutex and condition var initialization
code from I7018f38f29a19b130185b285f4acf22219e4228c.
Change-Id: If1d6b3d4f65c30154d3d6c9e0192a1ce72c0d495
CRs-Fixed: 587676
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 138bd3c..a550ecc 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2807,6 +2807,9 @@
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 @@
/* 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);