mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
move audio class to thread before starting
This commit is contained in:
parent
bb7d2a72b7
commit
1fb9bce78c
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -115,6 +115,9 @@ private:
|
|||
private:
|
||||
static Audio* instance;
|
||||
|
||||
private:
|
||||
AudioPrivate* d;
|
||||
|
||||
private:
|
||||
QThread* audioThread;
|
||||
QMutex mAudioLock;
|
||||
|
|
Loading…
Reference in New Issue
Block a user