[vlc-commits] contrib: live555: fix in_addr.s_addr field access
Victorien Le Couviour--Tuffet
git at videolan.org
Tue Oct 23 17:25:05 CEST 2018
vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Tue Sep 11 12:43:26 2018 +0200| [23258645c6d4c1b78bca9e52607fb2e85542e0ce] | committer: Thomas Guillem
contrib: live555: fix in_addr.s_addr field access
Fixes android NDK 17 build
(cherry picked from commit 9b8b7bc47993c1f245c535b90b613380e39fb138)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=23258645c6d4c1b78bca9e52607fb2e85542e0ce
---
contrib/src/live555/in_addr-s_addr-field.patch | 42 ++++++++++++++++++++++++++
contrib/src/live555/rules.mak | 6 ++++
2 files changed, 48 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 b77d96ce73..a9cecd80a3 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -76,6 +76,12 @@ endif
$(APPLY) $(SRC)/live555/add-pkgconfig-file.patch
# Expose Server:
$(APPLY) $(SRC)/live555/expose_server_string.patch
+ifdef HAVE_ANDROID
+ifneq ($(LEGACY_NDK), 1)
+ # Always access in_addr.s_addr field
+ $(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+endif
+endif
mv live.$(LIVE555_VERSION) $@ && touch $@
More information about the vlc-commits
mailing list