Commit d53a2f4f authored by Ghislain MARY's avatar Ghislain MARY

Fix crashes related to LinphoneVideoDefinition.

parent 68b4de89
......@@ -325,8 +325,6 @@ LinphoneCallParams * linphone_call_params_ref(LinphoneCallParams *cp) {
}
void linphone_call_params_unref(LinphoneCallParams *cp) {
if (cp->sent_vdef != NULL) linphone_video_definition_unref(cp->sent_vdef);
if (cp->recv_vdef != NULL) linphone_video_definition_unref(cp->recv_vdef);
belle_sip_object_unref(cp);
}
......@@ -358,6 +356,8 @@ static void _linphone_call_params_uninit(LinphoneCallParams *cp){
if (cp->custom_sdp_media_attributes[i]) sal_custom_sdp_attribute_free(cp->custom_sdp_media_attributes[i]);
}
if (cp->session_name) ms_free(cp->session_name);
if (cp->sent_vdef != NULL) linphone_video_definition_unref(cp->sent_vdef);
if (cp->recv_vdef != NULL) linphone_video_definition_unref(cp->recv_vdef);
}
static void _linphone_call_params_clone(LinphoneCallParams *dst, const LinphoneCallParams *src) {
......@@ -369,7 +369,9 @@ static void _linphone_call_params_clone(LinphoneCallParams *dst, const LinphoneC
belle_sip_object_t tmp = dst->base;
memcpy(dst, src, sizeof(LinphoneCallParams));
dst->base = tmp;
if (src->sent_vdef) dst->sent_vdef = linphone_video_definition_ref(src->sent_vdef);
if (src->recv_vdef) dst->recv_vdef = linphone_video_definition_ref(src->recv_vdef);
if (src->record_file) dst->record_file=ms_strdup(src->record_file);
if (src->session_name) dst->session_name=ms_strdup(src->session_name);
/*
......
......@@ -1964,13 +1964,13 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
#ifdef VIDEO_ENABLED
VideoStream *vstream;
#endif
MS_VIDEO_SIZE_ASSIGN(call->current_params->sent_vsize, UNKNOWN);
MS_VIDEO_SIZE_ASSIGN(call->current_params->recv_vsize, UNKNOWN);
#ifdef VIDEO_ENABLED
if (call->current_params->sent_vdef != NULL) linphone_video_definition_unref(call->current_params->sent_vdef);
call->current_params->sent_vdef = NULL;
if (call->current_params->recv_vdef != NULL) linphone_video_definition_unref(call->current_params->recv_vdef);
call->current_params->recv_vdef = NULL;
MS_VIDEO_SIZE_ASSIGN(call->current_params->sent_vsize, UNKNOWN);
MS_VIDEO_SIZE_ASSIGN(call->current_params->recv_vsize, UNKNOWN);
#ifdef VIDEO_ENABLED
vstream = call->videostream;
if (vstream != NULL) {
call->current_params->sent_vsize = video_stream_get_sent_video_size(vstream);
......
......@@ -5846,7 +5846,8 @@ static void sound_config_uninit(LinphoneCore *lc)
static void video_config_uninit(LinphoneCore *lc)
{
lp_config_set_string(lc->config,"video","size",linphone_video_definition_get_name(linphone_core_get_preferred_video_definition(lc)));
const LinphoneVideoDefinition *vdef = linphone_core_get_preferred_video_definition(lc);
lp_config_set_string(lc->config,"video","size",vdef ? linphone_video_definition_get_name(vdef) : NULL);
lp_config_set_int(lc->config,"video","display",lc->video_conf.display);
lp_config_set_int(lc->config,"video","capture",lc->video_conf.capture);
if (lc->video_conf.cams)
......
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