[Android] Thread mediaplayer native stop()
Geoffrey Métais
git at videolan.org
Thu Jul 27 16:23:27 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jul 27 10:06:10 2017 +0200| [1dbdcb3f3041d57ea0be07b929c3339719ade1b1] | committer: Geoffrey Métais
Thread mediaplayer native stop()
Workaround to prevent ANR, because some VLC modules hang on stop
> https://code.videolan.org/videolan/vlc-android/commit/1dbdcb3f3041d57ea0be07b929c3339719ade1b1
---
libvlc/src/org/videolan/libvlc/MediaPlayer.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index ba881f0d3..9c36d0399 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -621,7 +621,12 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
mPlaying = false;
mAudioReset = true;
}
- nativeStop();
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ nativeStop();
+ }
+ }).start();
}
/**
More information about the Android
mailing list