[vlc-commits] contrib: live555: fix in_addr.s_addr field access
Victorien Le Couviour--Tuffet
git at videolan.org
Tue Oct 23 14:53:50 CEST 2018
vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Tue Sep 11 12:43:26 2018 +0200| [9b8b7bc47993c1f245c535b90b613380e39fb138] | committer: Thomas Guillem
contrib: live555: fix in_addr.s_addr field access
Fixes android NDK 17 build
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b8b7bc47993c1f245c535b90b613380e39fb138
---
contrib/src/live555/in_addr-s_addr-field.patch | 42 ++++++++++++++++++++++++++
contrib/src/live555/rules.mak | 4 +++
2 files changed, 46 insertions(+)
diff --git a/contrib/src/live555/in_addr-s_addr-field.patch b/contrib/src/live555/in_addr-s_addr-field.patch
new file mode 100644
index 0000000000..d4ff3a9381
--- /dev/null
+++ b/contrib/src/live555/in_addr-s_addr-field.patch
@@ -0,0 +1,42 @@
+diff --git a/groupsock/GroupsockHelper.cpp b/groupsock/GroupsockHelper.cpp
+index 0ba2aa5..c675275 100644
+--- a/groupsock/GroupsockHelper.cpp
++++ b/groupsock/GroupsockHelper.cpp
+@@ -515,15 +515,9 @@ Boolean socketJoinGroupSSM(UsageEnvironment& env, int socket,
+ if (!IsMulticastAddress(groupAddress)) return True; // ignore this case
+
+ struct ip_mreq_source imr;
+-#ifdef __ANDROID__
+- imr.imr_multiaddr = groupAddress;
+- imr.imr_sourceaddr = sourceFilterAddr;
+- imr.imr_interface = ReceivingInterfaceAddr;
+-#else
+- imr.imr_multiaddr.s_addr = groupAddress;
+- imr.imr_sourceaddr.s_addr = sourceFilterAddr;
+- imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+-#endif
++ imr.imr_multiaddr.s_addr = groupAddress;
++ imr.imr_sourceaddr.s_addr = sourceFilterAddr;
++ imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+ if (setsockopt(socket, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP,
+ (const char*)&imr, sizeof (struct ip_mreq_source)) < 0) {
+ socketErr(env, "setsockopt(IP_ADD_SOURCE_MEMBERSHIP) error: ");
+@@ -541,15 +535,9 @@ Boolean socketLeaveGroupSSM(UsageEnvironment& /*env*/, int socket,
+ if (!IsMulticastAddress(groupAddress)) return True; // ignore this case
+
+ struct ip_mreq_source imr;
+-#ifdef __ANDROID__
+- imr.imr_multiaddr = groupAddress;
+- imr.imr_sourceaddr = sourceFilterAddr;
+- imr.imr_interface = ReceivingInterfaceAddr;
+-#else
+- imr.imr_multiaddr.s_addr = groupAddress;
+- imr.imr_sourceaddr.s_addr = sourceFilterAddr;
+- imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+-#endif
++ imr.imr_multiaddr.s_addr = groupAddress;
++ imr.imr_sourceaddr.s_addr = sourceFilterAddr;
++ imr.imr_interface.s_addr = ReceivingInterfaceAddr;
+ if (setsockopt(socket, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP,
+ (const char*)&imr, sizeof (struct ip_mreq_source)) < 0) {
+ return False;
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index fa1868bb15..6796535e64 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -79,6 +79,10 @@ endif
$(APPLY) $(SRC)/live555/expose_server_string.patch
# Fix creating static libs on mingw
$(APPLY) $(SRC)/live555/mingw-static-libs.patch
+ifdef HAVE_ANDROID
+ # Fix in_addr.s_addr field access
+ $(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+endif
mv live.$(LIVE555_VERSION) $@ && touch $@
More information about the vlc-commits
mailing list