From 6ec8a17270619f6217f7c7620424b1bd3657a7fa Mon Sep 17 00:00:00 2001
From: Sebastian Hahta <joseha@utu.fi>
Date: Fri, 3 Jul 2020 10:33:18 +0300
Subject: [PATCH] fix use of uninitialized variable

---
 components/audio/src/speaker.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/components/audio/src/speaker.cpp b/components/audio/src/speaker.cpp
index 9f3d6ecd8..48fcde2db 100644
--- a/components/audio/src/speaker.cpp
+++ b/components/audio/src/speaker.cpp
@@ -30,16 +30,13 @@ static int pa_speaker_callback(const void *input, void *output,
 
 #endif
 
-Speaker::Speaker(nlohmann::json &config) : ftl::Configurable(config), buffer_(nullptr) {
+Speaker::Speaker(nlohmann::json &config) : ftl::Configurable(config), buffer_(nullptr), stream_(nullptr) {
 	#ifdef HAVE_PORTAUDIO
 	ftl::audio::pa_init();
 	#else  // No portaudio
-
-	active_ = false;
 	LOG(ERROR) << "No audio support";
-
 	#endif
-
+	active_ = false;
 	extra_delay_ = value("delay",0.0f);
 	on("delay", [this](const ftl::config::Event &e) {
 		extra_delay_ = value("delay",0.0f);
-- 
GitLab