mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Fix wrong logic in linphone_core_set_preferred_video_definition().
This commit is contained in:
parent
379a7df153
commit
1dcd17198e
1 changed files with 7 additions and 12 deletions
|
|
@ -5319,20 +5319,15 @@ static bool_t video_definition_supported(const LinphoneVideoDefinition *vdef) {
|
|||
|
||||
void linphone_core_set_preferred_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef) {
|
||||
if (video_definition_supported(vdef)) {
|
||||
LinphoneVideoDefinition *oldvdef;
|
||||
if ((lc->video_conf.vdef == NULL) || linphone_video_definition_is_undefined(lc->video_conf.preview_vdef)) {
|
||||
oldvdef = lc->video_conf.vdef;
|
||||
} else {
|
||||
oldvdef = lc->video_conf.preview_vdef;
|
||||
}
|
||||
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);
|
||||
}
|
||||
LinphoneVideoDefinition *oldvdef = lc->video_conf.vdef;
|
||||
lc->video_conf.vdef = linphone_video_definition_ref(vdef);
|
||||
|
||||
if ((lc->previewstream != NULL) && (lc->video_conf.preview_vdef == NULL)
|
||||
&& (oldvdef != NULL) && !linphone_video_definition_equals(oldvdef, vdef)) {
|
||||
relaunch_video_preview(lc);
|
||||
}
|
||||
|
||||
if (oldvdef != NULL) linphone_video_definition_unref(oldvdef);
|
||||
if (linphone_core_ready(lc)) {
|
||||
lp_config_set_string(lc->config, "video", "size", linphone_video_definition_get_name(vdef));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue