[Android] Audio and Spu delay methods in LibVLC

Geoffrey Métais git at videolan.org
Mon Jan 19 17:20:50 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 19 17:19:40 2015 +0100| [8571c9b56a62cccea1a2a89038518e08bb6b75e5] | committer: Geoffrey Métais

Audio and Spu delay methods in LibVLC

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=8571c9b56a62cccea1a2a89038518e08bb6b75e5
---

 libvlc/jni/libvlcjni-track.c               |   32 ++++++++++++++++++++++++++++
 libvlc/src/org/videolan/libvlc/LibVLC.java |    8 +++++++
 2 files changed, 40 insertions(+)

diff --git a/libvlc/jni/libvlcjni-track.c b/libvlc/jni/libvlcjni-track.c
index ed13830..b02bb49 100644
--- a/libvlc/jni/libvlcjni-track.c
+++ b/libvlc/jni/libvlcjni-track.c
@@ -473,3 +473,35 @@ jint Java_org_videolan_libvlc_LibVLC_addSubtitleTrack(JNIEnv *env, jobject thiz,
         return -1;
     }
 }
+
+jint Java_org_videolan_libvlc_LibVLC_setAudioDelay(JNIEnv *env, jobject thiz, jlong delay)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return libvlc_audio_set_delay(mp, (int64_t) delay);
+    return -1;
+}
+
+jlong Java_org_videolan_libvlc_LibVLC_getAudioDelay(JNIEnv *env, jobject thiz)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return (jlong) libvlc_audio_get_delay(mp);
+    return 0;
+}
+
+jint Java_org_videolan_libvlc_LibVLC_setSpuDelay(JNIEnv *env, jobject thiz, jlong delay)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return libvlc_video_set_spu_delay(mp, (int64_t) delay);
+    return -1;
+}
+
+jlong Java_org_videolan_libvlc_LibVLC_getSpuDelay(JNIEnv *env, jobject thiz)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return (jlong) libvlc_video_get_spu_delay(mp);
+    return 0;
+}
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index a67e2f7..3f9eca1 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -736,6 +736,14 @@ public class LibVLC {
 
     public native int getSpuTracksCount();
 
+    public native int setAudioDelay(long delay);
+
+    public native int getAudioDelay();
+
+    public native int setSpuDelay(long delay);
+
+    public native int getSpuDelay();
+
     public static native String nativeToURI(String path);
     
     public native static void sendMouseEvent( int action, int button, int x, int y);



More information about the Android mailing list