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

Victorien Le Couviour--Tuffet git at videolan.org
Tue Oct 23 14:53:51 CEST 2018


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

contrib: live555: fix undeclared off64_t functions

Fixes android NDK 17 build:
ftello and fseeko are available from API level 24.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1aaff3b9609f5545bf44903ca23ef0c3be2421b1
---

 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 6796535e64..9f6a997517 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -82,6 +82,8 @@ endif
 ifdef HAVE_ANDROID
 	# Fix in_addr.s_addr field access
 	$(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
 
 	mv live.$(LIVE555_VERSION) $@ && touch $@



More information about the vlc-commits mailing list