From bf8bdaf61956cec40dd67d6b333591aa5cf684f1 Mon Sep 17 00:00:00 2001 From: tux3 Date: Sat, 7 Nov 2015 18:30:01 +0100 Subject: [PATCH] Improve perf of opening/closing AV tab Should help with #2424 --- src/video/camerasource.cpp | 3 ++- src/widget/form/settings/avform.cpp | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/video/camerasource.cpp b/src/video/camerasource.cpp index c006ea863..25fd5473c 100644 --- a/src/video/camerasource.cpp +++ b/src/video/camerasource.cpp @@ -172,7 +172,9 @@ bool CameraSource::subscribe() void CameraSource::unsubscribe() { + streamBlocker = true; QMutexLocker l{&biglock}; + streamBlocker = false; if (!_isOpen) { @@ -200,7 +202,6 @@ void CameraSource::unsubscribe() device->close(); } subscriptions--; - } bool CameraSource::openDevice() diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index ed74c5b30..d5d948d3e 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -243,9 +243,6 @@ void AVForm::getVideoDevices() bodyUI->videoDevCombobox->setCurrentIndex(videoDevIndex); bodyUI->videoDevCombobox->blockSignals(false); updateVideoModes(videoDevIndex); - - QString devName = videoDeviceList[videoDevIndex].first; - camera.open(devName); } void AVForm::getAudioInDevices()