[Android] MediaPlayer: reset Vout count on MediaChanged event

Thomas Guillem git at videolan.org
Tue Mar 8 15:34:11 CET 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar  8 15:32:39 2016 +0100| [31b122230c134ae007f405e526cbaef25454b38c] | committer: Thomas Guillem

MediaPlayer: reset Vout count on MediaChanged event

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

 libvlc/jni/libvlcjni-mediaplayer.c              | 1 +
 libvlc/src/org/videolan/libvlc/MediaPlayer.java | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libvlc/jni/libvlcjni-mediaplayer.c b/libvlc/jni/libvlcjni-mediaplayer.c
index d3082b6..f1cc35e 100644
--- a/libvlc/jni/libvlcjni-mediaplayer.c
+++ b/libvlc/jni/libvlcjni-mediaplayer.c
@@ -28,6 +28,7 @@
 JNIEnv *jni_get_env(const char *name);
 
 static const libvlc_event_type_t mp_events[] = {
+    libvlc_MediaPlayerMediaChanged,
     libvlc_MediaPlayerOpening,
     libvlc_MediaPlayerPlaying,
     libvlc_MediaPlayerPaused,
diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 7abf45a..edf2b29 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -26,7 +26,7 @@ package org.videolan.libvlc;
 public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
 
     public static class Event extends VLCEvent {
-        //public static final int MediaChanged        = 0x100;
+        public static final int MediaChanged        = 0x100;
         //public static final int NothingSpecial      = 0x101;
         public static final int Opening             = 0x102;
         //public static final int Buffering           = 0x103;
@@ -811,6 +811,7 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
     @Override
     protected synchronized Event onEventNative(int eventType, long arg1, float arg2) {
         switch (eventType) {
+            case Event.MediaChanged:
             case Event.Stopped:
             case Event.EndReached:
             case Event.EncounteredError:



More information about the Android mailing list