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()
|
void Audio::startAudioThread()
|
||||||
{
|
{
|
||||||
|
moveToThread(audioThread);
|
||||||
|
|
||||||
if (!audioThread->isRunning())
|
if (!audioThread->isRunning())
|
||||||
audioThread->start();
|
audioThread->start();
|
||||||
else
|
else
|
||||||
qWarning("Audio thread already started -> ignored.");
|
qWarning("Audio thread already started -> ignored.");
|
||||||
|
|
||||||
moveToThread(audioThread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -115,6 +115,9 @@ private:
|
||||||
private:
|
private:
|
||||||
static Audio* instance;
|
static Audio* instance;
|
||||||
|
|
||||||
|
private:
|
||||||
|
AudioPrivate* d;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QThread* audioThread;
|
QThread* audioThread;
|
||||||
QMutex mAudioLock;
|
QMutex mAudioLock;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user