diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index 69858f360..13496bb53 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -476,7 +476,7 @@ bool Audio::isInputReady() /** Returns true if the output device is open */ -bool Audio::isOutputClosed() +bool Audio::isOutputReady() { QMutexLocker locker(&audioOutLock); return alOutDev; diff --git a/src/audio/audio.h b/src/audio/audio.h index adbad5ecf..4f02a5da2 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -70,7 +70,7 @@ public: bool openOutput(const QString& outDevDescr); bool isInputReady(); - bool isOutputClosed(); + bool isOutputReady(); static void createSource(ALuint* source); static void deleteSource(ALuint* source); diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 4ec1401cf..a2a82b78e 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -316,8 +316,8 @@ void AVForm::onInDevChanged(const QString &deviceDescriptor) Settings::getInstance().setInDev(deviceDescriptor); Audio& audio = Audio::getInstance(); - audio.unsubscribeInput(); - audio.subscribeInput(); + if (audio.isInputReady()) + audio.openInput(deviceDescriptor); } void AVForm::onOutDevChanged(const QString& deviceDescriptor) @@ -325,8 +325,8 @@ void AVForm::onOutDevChanged(const QString& deviceDescriptor) Settings::getInstance().setOutDev(deviceDescriptor); Audio& audio = Audio::getInstance(); - audio.unsubscribeInput(); - audio.subscribeInput(); + if (audio.isOutputReady()) + audio.openOutput(deviceDescriptor); } void AVForm::onFilterAudioToggled(bool filterAudio)