[Android] Fix vlcjni set_time/set_position for 4.0

Alexandre Janniaux git at videolan.org
Fri Jul 20 09:12:58 CEST 2018


vlc-android | branch: master | Alexandre Janniaux <alexandre.janniaux at gmail.com> | Thu Jul 19 16:45:48 2018 +0200| [bc7237f2687263848c5352d11f9ff8a2f9cdd6c8] | committer: Thomas Guillem

Fix vlcjni set_time/set_position for 4.0

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> https://code.videolan.org/videolan/vlc-android/commit/bc7237f2687263848c5352d11f9ff8a2f9cdd6c8
---

 libvlc/jni/libvlcjni-mediaplayer.c | 9 +++++++++
 libvlc/jni/thumbnailer.c           | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/libvlc/jni/libvlcjni-mediaplayer.c b/libvlc/jni/libvlcjni-mediaplayer.c
index ffa3586e9..46fc2ee60 100644
--- a/libvlc/jni/libvlcjni-mediaplayer.c
+++ b/libvlc/jni/libvlcjni-mediaplayer.c
@@ -382,7 +382,11 @@ Java_org_videolan_libvlc_MediaPlayer_setTime(JNIEnv *env, jobject thiz,
     if (!p_obj)
         return;
 
+#if defined(LIBVLC_VERSION_MAJOR) && LIBVLC_VERSION_MAJOR < 4
     libvlc_media_player_set_time(p_obj->u.p_mp, time);
+#else
+    libvlc_media_player_set_time(p_obj->u.p_mp, time, false);
+#endif
 }
 
 jfloat
@@ -405,7 +409,12 @@ Java_org_videolan_libvlc_MediaPlayer_setPosition(JNIEnv *env, jobject thiz,
     if (!p_obj)
         return;
 
+#if defined(LIBVLC_VERSION_MAJOR) && LIBVLC_VERSION_MAJOR < 4
     libvlc_media_player_set_position(p_obj->u.p_mp, pos);
+#else
+    libvlc_media_player_set_position(p_obj->u.p_mp, pos, false);
+#endif
+
 }
 
 jlong
diff --git a/libvlc/jni/thumbnailer.c b/libvlc/jni/thumbnailer.c
index 155c3f0a9..1aa09a5c9 100644
--- a/libvlc/jni/thumbnailer.c
+++ b/libvlc/jni/thumbnailer.c
@@ -285,7 +285,12 @@ Java_org_videolan_libvlc_util_VLCUtil_nativeGetThumbnail(JNIEnv *env,
 
     /* Play the media. */
     libvlc_media_player_play(mp);
+
+#if defined(LIBVLC_VERSION_MAJOR) && LIBVLC_VERSION_MAJOR < 4
     libvlc_media_player_set_position(mp, THUMBNAIL_POSITION);
+#else
+    libvlc_media_player_set_position(mp, THUMBNAIL_POSITION, false);
+#endif
 
     /* Wait for the thumbnail to be generated. */
     pthread_mutex_lock(&sys->doneMutex);



More information about the Android mailing list