[vlc-devel] [PATCH 01/13] contrib: live555: fix in_addr.s_addr field access
Victorien Le Couviour--Tuffet
victorien.lecouviour.tuffet at gmail.com
Tue Oct 2 11:14:24 CEST 2018
Fixes android NDK 17 build
---
.../src/live555/in_addr-s_addr-field.patch | 42 +++++++++++++++++++
contrib/src/live555/rules.mak | 4 ++
2 files changed, 46 insertions(+)
create mode 100644 contrib/src/live555/in_addr-s_addr-field.patch
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 $@
--
2.19.0
More information about the vlc-devel
mailing list