diff --git a/linphone-desktop/src/components/settings/SettingsModel.cpp b/linphone-desktop/src/components/settings/SettingsModel.cpp index 7bd52647a..fb96874b4 100644 --- a/linphone-desktop/src/components/settings/SettingsModel.cpp +++ b/linphone-desktop/src/components/settings/SettingsModel.cpp @@ -182,6 +182,16 @@ void SettingsModel::setVideoFramerate (int framerate) { inline QVariantMap createMapFromVideoDefinition (const shared_ptr &definition) { QVariantMap map; + if (!definition) { + Q_ASSERT(!CoreManager::getInstance()->getCore()->videoSupported()); + + map["name"] = QStringLiteral("Bad EGG"); + map["width"] = QStringLiteral("?????"); + map["height"] = QStringLiteral("?????"); + + return map; + } + map["name"] = ::Utils::coreStringToAppString(definition->getName()); map["width"] = definition->getWidth(); map["height"] = definition->getHeight(); diff --git a/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml b/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml index e99c05efa..a82b93b2f 100644 --- a/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml +++ b/linphone-desktop/ui/views/App/Settings/SettingsVideo.qml @@ -28,9 +28,9 @@ TabContainer { label: qsTr('videoInputDeviceLabel') ComboBox { - currentIndex: Utils.findIndex(model, function (device) { + currentIndex: Number(Utils.findIndex(model, function (device) { return device === SettingsModel.videoDevice - }) + })) // Number cast => Index is null if app does not support video. model: SettingsModel.videoDevices onActivated: SettingsModel.videoDevice = model[index] @@ -74,9 +74,9 @@ TabContainer { label: qsTr('videoSizeLabel') ComboBox { - currentIndex: Utils.findIndex(model, function (definition) { + currentIndex: Number(Utils.findIndex(model, function (definition) { return definition.value.name === SettingsModel.videoDefinition.name - }) + })) // Number cast => Index is null if app does not support video. model: SettingsModel.supportedVideoDefinitions.map(function (definition) { return { key: definition.name + ' (' + definition.width + 'x' + definition.height + ')', diff --git a/submodules/linphone b/submodules/linphone index 2b93067a7..df4cc8d70 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 2b93067a78a0373f24ee868d5bd0523f6be15d14 +Subproject commit df4cc8d7079e6191bf0bb389da809736c5607b70