Skip to content
Snippets Groups Projects
Commit 2da169af authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

videoview: don't restart the same device through the context menu

-  once the switch video input device option is triggered,
   only change if the current device is not the currently
   used device

Change-Id: I8b8c2a9a51981c5a8c2b4597d8b8f298d4397259
parent 2eefb501
No related branches found
No related tags found
No related merge requests found
...@@ -230,6 +230,9 @@ VideoView::showContextMenu(const QPoint& position) ...@@ -230,6 +230,9 @@ VideoView::showContextMenu(const QPoint& position)
connect(deviceAction, &QAction::triggered, connect(deviceAction, &QAction::triggered,
[this, deviceName]() { [this, deviceName]() {
auto device = deviceName.toStdString(); auto device = deviceName.toStdString();
if (LRCInstance::avModel().getCurrentVideoCaptureDevice() == device) {
return;
}
resetPreview(); resetPreview();
LRCInstance::avModel().switchInputTo(device); LRCInstance::avModel().switchInputTo(device);
LRCInstance::avModel().setCurrentVideoCaptureDevice(device); LRCInstance::avModel().setCurrentVideoCaptureDevice(device);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment