diff --git a/plugins/elements/gstfdsink.c b/plugins/elements/gstfdsink.c index ef24800879..54a169b174 100644 --- a/plugins/elements/gstfdsink.c +++ b/plugins/elements/gstfdsink.c @@ -69,13 +69,11 @@ #define off_t guint64 #endif -#ifdef __BIONIC__ /* Android */ -#undef lseek -#define lseek lseek64 +#if defined(__BIONIC__) /* Android */ +#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21 #undef fstat #define fstat fstat64 -#undef off_t -#define off_t guint64 +#endif #endif static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index 963bcbd432..6d61efeb6b 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -81,11 +81,11 @@ #include "gstfdsrc.h" #ifdef __BIONIC__ /* Android */ -#undef lseek -#define lseek lseek64 +#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21 #undef fstat #define fstat fstat64 #endif +#endif static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 4ce527e303..58ae8d166a 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -70,13 +70,6 @@ #include #endif -#ifdef __BIONIC__ /* Android */ -#undef lseek -#define lseek lseek64 -#undef off_t -#define off_t guint64 -#endif - #include "gstelements_private.h" #include "gstfilesink.h" @@ -401,12 +394,12 @@ gst_file_sink_open_file (GstFileSink * sink) sink->buffer = g_malloc (sink->buffer_size); buffer_size = sink->buffer_size; } - /* Cygwin does not have __fbufsize */ -#if defined(HAVE_STDIO_EXT_H) && !defined(__CYGWIN__) + /* Cygwin does not have __fbufsize, android adds it in API 23 */ +#if defined(HAVE_STDIO_EXT_H) && (!defined(__CYGWIN__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 23)) GST_DEBUG_OBJECT (sink, "change buffer size %u to %u, mode %d", (guint) __fbufsize (sink->file), buffer_size, mode); #else - GST_DEBUG_OBJECT (sink, "change buffer size to %u, mode %d", + GST_DEBUG_OBJECT (sink, "change buffer size to %u, mode %d", sink->buffer_size, mode); #endif if (setvbuf (sink->file, sink->buffer, mode, buffer_size) != 0) { diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 5307351961..76ab12cb4d 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -66,12 +66,10 @@ #endif #ifdef __BIONIC__ /* Android */ -#undef lseek -#define lseek lseek64 +#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21 #undef fstat #define fstat fstat64 -#undef off_t -#define off_t guint64 +#endif #endif #include diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 4fdf3489b4..fb5452e37c 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -75,10 +75,6 @@ #endif #ifdef __BIONIC__ /* Android */ -#undef lseek -#define lseek lseek64 -#undef off_t -#define off_t guint64 #include #endif diff --git a/plugins/elements/gstsparsefile.c b/plugins/elements/gstsparsefile.c index f8a0af1998..0ff6b16b66 100644 --- a/plugins/elements/gstsparsefile.c +++ b/plugins/elements/gstsparsefile.c @@ -36,13 +36,6 @@ #include #endif -#ifdef __BIONIC__ /* Android */ -#undef lseek -#define lseek lseek64 -#undef off_t -#define off_t guint64 -#endif - #ifdef HAVE_FSEEKO #define FSEEK_FILE(file,offset) (fseeko (file, (off_t) offset, SEEK_SET) != 0) #elif defined (G_OS_UNIX) || defined (G_OS_WIN32)