mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:19:05 +02:00
added mutex for audio handler
This commit is contained in:
parent
e709561a62
commit
e581c66b56
2 changed files with 4 additions and 1 deletions
|
@ -680,7 +680,9 @@ void OffscreenQmlSurface::create() {
|
||||||
// Setup the update of the QML media components with the current audio output device
|
// Setup the update of the QML media components with the current audio output device
|
||||||
QObject::connect(&_audioOutputUpdateTimer, &QTimer::timeout, this, [this]() {
|
QObject::connect(&_audioOutputUpdateTimer, &QTimer::timeout, this, [this]() {
|
||||||
if (_currentAudioOutputDevice.size() > 0) {
|
if (_currentAudioOutputDevice.size() > 0) {
|
||||||
new AudioHandler(sharedFromThis(), _currentAudioOutputDevice);
|
QMutexLocker lock(&_audioHandlerMutex);
|
||||||
|
QString audioDeviceName = _currentAudioOutputDevice;
|
||||||
|
new AudioHandler(sharedFromThis(), audioDeviceName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
int waitForAudioQmlMs = 200;
|
int waitForAudioQmlMs = 200;
|
||||||
|
|
|
@ -173,6 +173,7 @@ private:
|
||||||
uint64_t _lastRenderTime { 0 };
|
uint64_t _lastRenderTime { 0 };
|
||||||
uvec2 _size;
|
uvec2 _size;
|
||||||
|
|
||||||
|
QMutex _audioHandlerMutex;
|
||||||
QTimer _audioOutputUpdateTimer;
|
QTimer _audioOutputUpdateTimer;
|
||||||
QString _currentAudioOutputDevice;
|
QString _currentAudioOutputDevice;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue