[Android] MediaPlayer: fix crash on media player restart

Duncan McNamara git at videolan.org
Wed Dec 5 11:10:35 CET 2018


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Dec  4 10:01:01 2018 +0100| [3df90cad57e7909cc387905c8bc18cc2b72fafd1] | committer: Geoffrey Métais

MediaPlayer: fix crash on media player restart

Calls detachview in onReleaseNative() to ensure
that the VideoHelper callbacks are removed.
If not updateVideoSurfaces() can be called with
a VLCInstance null

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

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

 libvlc/src/org/videolan/libvlc/MediaPlayer.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index dd1898dc5..17176a766 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -1334,6 +1334,7 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
 
     @Override
     protected void onReleaseNative() {
+        detachViews();
         mWindow.detachViews();
         registerAudioPlug(false);
 



More information about the Android mailing list