Commit 1dcd1719 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix wrong logic in linphone_core_set_preferred_video_definition().

parent 379a7df1
...@@ -5319,20 +5319,15 @@ static bool_t video_definition_supported(const LinphoneVideoDefinition *vdef) { ...@@ -5319,20 +5319,15 @@ static bool_t video_definition_supported(const LinphoneVideoDefinition *vdef) {
void linphone_core_set_preferred_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef) { void linphone_core_set_preferred_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef) {
if (video_definition_supported(vdef)) { if (video_definition_supported(vdef)) {
LinphoneVideoDefinition *oldvdef; LinphoneVideoDefinition *oldvdef = lc->video_conf.vdef;
if ((lc->video_conf.vdef == NULL) || linphone_video_definition_is_undefined(lc->video_conf.preview_vdef)) { lc->video_conf.vdef = linphone_video_definition_ref(vdef);
oldvdef = lc->video_conf.vdef;
} else { if ((lc->previewstream != NULL) && (lc->video_conf.preview_vdef == NULL)
oldvdef = lc->video_conf.preview_vdef; && (oldvdef != NULL) && !linphone_video_definition_equals(oldvdef, vdef)) {
} relaunch_video_preview(lc);
if ((oldvdef == NULL) || !linphone_video_definition_equals(oldvdef, vdef)) {
lc->video_conf.vdef = linphone_video_definition_ref(vdef);
if (oldvdef != NULL) linphone_video_definition_unref(oldvdef);
if (lc->previewstream != NULL) {
relaunch_video_preview(lc);
}
} }
if (oldvdef != NULL) linphone_video_definition_unref(oldvdef);
if (linphone_core_ready(lc)) { if (linphone_core_ready(lc)) {
lp_config_set_string(lc->config, "video", "size", linphone_video_definition_get_name(vdef)); lp_config_set_string(lc->config, "video", "size", linphone_video_definition_get_name(vdef));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment