From 28950cd3f4419edf984e8fa1229076dbee8a74cf Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 20 Nov 2017 15:18:39 +0100 Subject: [PATCH] Call new mediastreamer2 stream type API to fix ringing from linphone in wrong stream on Android --- coreapi/linphonecall.c | 2 ++ coreapi/linphonecore.c | 1 + 2 files changed, 3 insertions(+) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 0ac393524..94cbde82f 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2698,6 +2698,8 @@ void linphone_call_init_audio_stream(LinphoneCall *call){ char* cname; if (call->audiostream != NULL) return; + ms_snd_card_set_stream_type(lc->sound_conf.play_sndcard, MS_SND_CARD_STREAM_VOICE); + if (call->sessions[call->main_audio_stream_index].rtp_session==NULL){ SalMulticastRole multicast_role = linphone_call_get_multicast_role(call,SalAudio); SalMediaDescription *remotedesc=NULL; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d5fae6965..1c87c5b76 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3683,6 +3683,7 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){ if (lc->ringstream && lc->dmfs_playing_start_time!=0){ linphone_core_stop_dtmf_stream(lc); } + ms_snd_card_set_stream_type(ringcard, MS_SND_CARD_STREAM_RING); linphone_ringtoneplayer_start(lc->factory, lc->ringtoneplayer, ringcard, lc->sound_conf.local_ring, 2000); }else{ /* else play a tone within the context of the current call */