From 64ac0d50819fb1e400a1a744cdd9fdf7286b70a9 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 3 Nov 2016 22:57:40 +0100 Subject: [PATCH] If multicast is used, create RTP socket with the same address familly as the multicast address, in order to workaround issues with dual stack sockets and multicast, especially on mac os. --- coreapi/linphonecall.c | 9 ++++++--- mediastreamer2 | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index a657ec11e..bbf1b27ff 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -668,13 +668,16 @@ static const char *linphone_call_get_bind_ip_for_stream(LinphoneCall *call, int const char *bind_ip = lp_config_get_string(call->core->config,"rtp","bind_address", call->af == AF_INET6 ? "::0" : "0.0.0.0"); PortConfig *pc = &call->media_ports[stream_index]; - if (stream_index<2 && pc->multicast_ip[0]!='\0'){ + if (pc->multicast_ip[0]!='\0'){ if (call->dir==LinphoneCallOutgoing){ /*as multicast sender, we must decide a local interface to use to send multicast, and bind to it*/ linphone_core_get_local_ip_for(strchr(pc->multicast_ip,':') ? AF_INET6 : AF_INET, NULL, pc->multicast_bind_ip); bind_ip = pc->multicast_bind_ip; - + }else{ + /*otherwise we shall use an address family of the same family of the multicast address, because + * dual stack socket and multicast don't work well on Mac OS (linux is OK, as usual).*/ + bind_ip = strchr(pc->multicast_ip,':') ? "::0" : "0.0.0.0"; } } return bind_ip; @@ -683,7 +686,7 @@ static const char *linphone_call_get_bind_ip_for_stream(LinphoneCall *call, int static const char *linphone_call_get_public_ip_for_stream(LinphoneCall *call, int stream_index){ const char *public_ip=call->media_localip; - if (stream_index<2 && call->media_ports[stream_index].multicast_ip[0]!='\0') + if (call->media_ports[stream_index].multicast_ip[0]!='\0') public_ip=call->media_ports[stream_index].multicast_ip; return public_ip; } diff --git a/mediastreamer2 b/mediastreamer2 index 3a1db4a3b..3f00520a6 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3a1db4a3b30bfb3044d3dfb8c977fe66300c44f2 +Subproject commit 3f00520a6159dfe53f85f8e6e26ff79dc54f6277