[vlc-commits] contrib: live555: fix undeclared off64_t functions

Victorien Le Couviour--Tuffet git at videolan.org
Tue Oct 23 17:25:07 CEST 2018


vlc/vlc-3.0 | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Mon Sep 17 08:27:25 2018 +0200| [6674ee75f1bf75a6702c0437d431055ea7b0e45f] | committer: Thomas Guillem

contrib: live555: fix undeclared off64_t functions

Fixes android NDK 17 build:
ftello and fseeko are available from API level 24.
(cherry picked from commit 1aaff3b9609f5545bf44903ca23ef0c3be2421b1)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6674ee75f1bf75a6702c0437d431055ea7b0e45f
---

 contrib/src/live555/file-offset-bits-64.patch | 22 ++++++++++++++++++++++
 contrib/src/live555/rules.mak                 |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/contrib/src/live555/file-offset-bits-64.patch b/contrib/src/live555/file-offset-bits-64.patch
new file mode 100644
index 0000000000..7231c8892d
--- /dev/null
+++ b/contrib/src/live555/file-offset-bits-64.patch
@@ -0,0 +1,22 @@
+diff --git a/liveMedia/InputFile.cpp b/liveMedia/InputFile.cpp
+index 57bd262..fe1a73b 100644
+--- a/liveMedia/InputFile.cpp
++++ b/liveMedia/InputFile.cpp
+@@ -78,7 +78,7 @@ int64_t SeekFile64(FILE *fid, int64_t offset, int whence) {
+ #if (defined(__WIN32__) || defined(_WIN32)) && !defined(_WIN32_WCE)
+   return _lseeki64(_fileno(fid), offset, whence) == (int64_t)-1 ? -1 : 0;
+ #else
+-#if defined(_WIN32_WCE)
++#if defined(_WIN32_WCE) || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+   return fseek(fid, (long)(offset), whence);
+ #else
+   return fseeko(fid, (off_t)(offset), whence);
+@@ -94,7 +94,7 @@ int64_t TellFile64(FILE *fid) {
+ #if (defined(__WIN32__) || defined(_WIN32)) && !defined(_WIN32_WCE)
+   return _telli64(_fileno(fid));
+ #else
+-#if defined(_WIN32_WCE)
++#if defined(_WIN32_WCE) || (defined(__ANDROID__) && __ANDROID_API__ < 24)
+   return ftell(fid);
+ #else
+   return ftello(fid);
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index a9cecd80a3..9b275ec33b 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -80,6 +80,8 @@ ifdef HAVE_ANDROID
 ifneq ($(LEGACY_NDK), 1)
 	# Always access in_addr.s_addr field
 	$(APPLY) $(SRC)/live555/in_addr-s_addr-field.patch
+	# Don't use unavailable off64_t functions
+	$(APPLY) $(SRC)/live555/file-offset-bits-64.patch
 endif
 endif
 



More information about the vlc-commits mailing list