From 90678a34b1be20dccc5b3c2de9b2632a51b2012a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 16 Jan 2017 12:21:51 +0100 Subject: [PATCH] Reflect real media directions in the current call params. --- coreapi/linphonecall.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 21e53e43b..2e274e1b9 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -688,24 +688,30 @@ void linphone_call_update_biggest_desc(LinphoneCall *call, SalMediaDescription * static void force_streams_dir_according_to_state(LinphoneCall *call, SalMediaDescription *md){ int i; - switch (call->state){ - case LinphoneCallPausing: - case LinphoneCallPaused: - break; - default: - return; - break; - } - for (i=0; istreams[i]; - if (sd->dir != SalStreamInactive) { - sd->dir = SalStreamSendOnly; - if (sd->type == SalVideo){ - if (lp_config_get_int(call->core->config, "sip", "inactive_video_on_pause", 0)) { - sd->dir = SalStreamInactive; + + switch (call->state){ + case LinphoneCallPausing: + case LinphoneCallPaused: + if (sd->dir != SalStreamInactive) { + sd->dir = SalStreamSendOnly; + if (sd->type == SalVideo){ + if (lp_config_get_int(call->core->config, "sip", "inactive_video_on_pause", 0)) { + sd->dir = SalStreamInactive; + } + } } - } + break; + default: + break; + } + + /* Reflect the stream directions in the call params */ + if (i == call->main_audio_stream_index) { + linphone_call_params_set_audio_direction(call->current_params, media_direction_from_sal_stream_dir(sd->dir)); + } else if (i == call->main_video_stream_index) { + linphone_call_params_set_video_direction(call->current_params, media_direction_from_sal_stream_dir(sd->dir)); } } }