diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-08-12 14:13:43 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-08-12 14:07:21 +0000 |
commit | 8ba1e65291b162f8e8aee515294507fc4e3b93d6 (patch) | |
tree | 1fcf3d3d4f5671ccdd85b5f38594792d4bb87655 /src/multimedia/qmediaserviceprovider.cpp | |
parent | dc1712d4b24bcc32109033412793dfe39438c845 (diff) |
Fix camera plugin selection.
When requesting a camera plugin for a given device id, it should fall
back to any available plugin if that device id is not found.
Change-Id: I685294c7fdcaa72bce70178b0aae2ec92e79e107
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/multimedia/qmediaserviceprovider.cpp')
-rw-r--r-- | src/multimedia/qmediaserviceprovider.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/multimedia/qmediaserviceprovider.cpp b/src/multimedia/qmediaserviceprovider.cpp index c852e3e7c..38d31eac2 100644 --- a/src/multimedia/qmediaserviceprovider.cpp +++ b/src/multimedia/qmediaserviceprovider.cpp @@ -359,19 +359,14 @@ public: } break; case QMediaServiceProviderHint::Device: { + plugin = plugins[0]; foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { QMediaServiceSupportedDevicesInterface *iface = qobject_cast<QMediaServiceSupportedDevicesInterface*>(currentPlugin); - if (!iface) { - // the plugin may support the device, - // but this choice still can be overridden + if (iface && iface->devices(type).contains(hint.device())) { plugin = currentPlugin; - } else { - if (iface->devices(type).contains(hint.device())) { - plugin = currentPlugin; - break; - } + break; } } } |