summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2016-04-19 12:26:45 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2016-04-22 11:44:51 +0000
commita75f8fd0bb19b76a7577c695208b385381a35278 (patch)
tree4dc28d59a2629d467a9c6e785d61f4e18d909bff /src
parenta0a20157efab21c07f327c70bd8603b5973f9a39 (diff)
winrt: Fix device watcher handling
When device watcher has been started it can have the enumerationComplete state in addition to started. Hence only start the watcher if none of those two states is present. This fixes an assert where starting an already started watcher failed. Change-Id: Idc3af256845f0993a26e8d186b499ef1c7e7dacc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp b/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp
index cd3a7fa04..24a3a911a 100644
--- a/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp
+++ b/src/plugins/winrt/qwinrtvideodeviceselectorcontrol.cpp
@@ -204,7 +204,8 @@ public:
DeviceWatcherStatus status;
hr = deviceWatcher->get_Status(&status);
Q_ASSERT_SUCCEEDED(hr);
- if (status != DeviceWatcherStatus_Started) {
+ if (status != DeviceWatcherStatus_Started &&
+ status != DeviceWatcherStatus_EnumerationCompleted) {
// We can't immediately Start() if we have just called Stop()
while (status == DeviceWatcherStatus_Stopping) {
QThread::yieldCurrentThread();