mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 22:33:56 +02:00
repairs to local audio injector cleanup
This commit is contained in:
parent
9461d5d8d1
commit
c9c53453c3
2 changed files with 5 additions and 10 deletions
|
@ -967,15 +967,15 @@ bool AudioClient::outputLocalInjector(bool isStereo, qreal volume, AudioInjector
|
|||
localFormat.setChannelCount(isStereo ? 2 : 1);
|
||||
|
||||
QAudioOutput* localOutput = new QAudioOutput(getNamedAudioDeviceForMode(QAudio::AudioOutput, _outputAudioDeviceName),
|
||||
localFormat);
|
||||
localFormat,
|
||||
injector);
|
||||
localOutput->setVolume(volume);
|
||||
|
||||
// move the localOutput to the same thread as the local injector buffer
|
||||
localOutput->moveToThread(injector->getLocalBuffer()->thread());
|
||||
|
||||
// have it be cleaned up when that thread is done
|
||||
connect(injector->thread(), &QThread::finished, localOutput, &QAudioOutput::stop);
|
||||
connect(injector->thread(), &QThread::finished, localOutput, &QAudioOutput::deleteLater);
|
||||
// have it be cleaned up when that injector is done
|
||||
connect(injector, &AudioInjector::finished, localOutput, &QAudioOutput::stop);
|
||||
|
||||
qDebug() << "Starting QAudioOutput for local injector" << localOutput;
|
||||
|
||||
|
|
|
@ -108,12 +108,7 @@ void AudioInjector::injectLocally() {
|
|||
// give our current send position to the local buffer
|
||||
_localBuffer->setCurrentOffset(_currentSendPosition);
|
||||
|
||||
QMetaObject::invokeMethod(_localAudioInterface, "outputLocalInjector",
|
||||
Qt::BlockingQueuedConnection,
|
||||
Q_RETURN_ARG(bool, success),
|
||||
Q_ARG(bool, _options.stereo),
|
||||
Q_ARG(qreal, _options.volume),
|
||||
Q_ARG(AudioInjector*, this));
|
||||
success = _localAudioInterface->outputLocalInjector(_options.stereo, _options.volume, this);
|
||||
|
||||
// if we're not looping and the buffer tells us it is empty then emit finished
|
||||
connect(_localBuffer, &AudioInjectorLocalBuffer::bufferEmpty, this, &AudioInjector::stop);
|
||||
|
|
Loading…
Reference in a new issue