From 1fb9bce78c973cc582296daf6c0335b94540cf07 Mon Sep 17 00:00:00 2001 From: Nils Fenner Date: Sat, 14 Nov 2015 21:50:32 +0100 Subject: [PATCH] move audio class to thread before starting --- src/audio/audio.cpp | 3 ++- src/audio/audio.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index b44bd58c1..802aca180 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -108,12 +108,13 @@ Start the audio thread for capture and playback. */ void Audio::startAudioThread() { + moveToThread(audioThread); + if (!audioThread->isRunning()) audioThread->start(); else qWarning("Audio thread already started -> ignored."); - moveToThread(audioThread); } /** diff --git a/src/audio/audio.h b/src/audio/audio.h index ef5df9d46..b00ec2e20 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -115,6 +115,9 @@ private: private: static Audio* instance; +private: + AudioPrivate* d; + private: QThread* audioThread; QMutex mAudioLock;