Commit 2130afe5 authored by Sandrine Avakian's avatar Sandrine Avakian

Fixing bug in SDP RTP port when all audio codecs are disabled in a call.

In this case, now the RTP port is set to 0 and the audio stream is inactive.
parent f0d1446f
......@@ -708,6 +708,16 @@ void linphone_call_make_local_media_description(LinphoneCall *call) {
md->custom_sdp_attributes = sal_custom_sdp_attribute_clone(params->custom_sdp_attributes);
/*set audio capabilities */
codec_hints.bandwidth_limit=params->audio_bw;
codec_hints.max_codecs=-1;
codec_hints.previously_used=old_md ? old_md->streams[call->main_audio_stream_index].already_assigned_payloads : NULL;
l=make_codec_list(lc, &codec_hints, SalAudio, lc->codecs_conf.audio_codecs);
// in case where no audio codec was found for this stream, the audio is disabled
if (l == NULL) {
params->has_audio = FALSE;
}
if (params->has_audio) {
strncpy(md->streams[call->main_audio_stream_index].rtp_addr,linphone_call_get_public_ip_for_stream(call,call->main_audio_stream_index),sizeof(md->streams[call->main_audio_stream_index].rtp_addr));
strncpy(md->streams[call->main_audio_stream_index].rtcp_addr,linphone_call_get_public_ip_for_stream(call,call->main_audio_stream_index),sizeof(md->streams[call->main_audio_stream_index].rtcp_addr));
......@@ -722,10 +732,6 @@ void linphone_call_make_local_media_description(LinphoneCall *call) {
md->streams[call->main_audio_stream_index].ptime=params->down_ptime;
else
md->streams[call->main_audio_stream_index].ptime=linphone_core_get_download_ptime(lc);
codec_hints.bandwidth_limit=params->audio_bw;
codec_hints.max_codecs=-1;
codec_hints.previously_used=old_md ? old_md->streams[call->main_audio_stream_index].already_assigned_payloads : NULL;
l=make_codec_list(lc, &codec_hints, SalAudio, lc->codecs_conf.audio_codecs);
md->streams[call->main_audio_stream_index].max_rate=get_max_codec_sample_rate(l);
md->streams[call->main_audio_stream_index].payloads=l;
if (call->audiostream && call->audiostream->ms.sessions.rtp_session) {
......
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