[Android] Check mediaplayer is set from main thread

Geoffrey Métais git at videolan.org
Tue Nov 21 15:38:55 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 21 11:48:35 2017 +0100| [e19847d1ad643314876b716b3c5d49060ba3a03c] | committer: Geoffrey Métais

Check mediaplayer is set from main thread

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 217046d88..9742ea2bb 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -83,6 +83,7 @@ import org.videolan.vlc.gui.AudioPlayerContainerActivity;
 import org.videolan.vlc.gui.helpers.AudioUtil;
 import org.videolan.vlc.gui.helpers.BitmapUtil;
 import org.videolan.vlc.gui.helpers.NotificationHelper;
+import org.videolan.vlc.gui.helpers.UiTools;
 import org.videolan.vlc.gui.preferences.PreferencesActivity;
 import org.videolan.vlc.gui.preferences.PreferencesFragment;
 import org.videolan.vlc.gui.video.PopupManager;
@@ -233,6 +234,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
     }
 
     private MediaPlayer newMediaPlayer() {
+        UiTools.checkMainThread();
         final MediaPlayer mp = new MediaPlayer(LibVLC());
         final String aout = VLCOptions.getAout(mSettings);
         if (aout != null)



More information about the Android mailing list