From 1b496b563255c851e5497c2208b8193b91416ebc Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 Dec 2017 09:00:36 +0100 Subject: [PATCH] move mediaplayer releasing back on main thread --- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 4942ea351..7ee976475 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -467,11 +467,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee } private fun releaseMediaPlayer() { - Thread { - mMediaPlayer?.setSurface(null) - mMediaPlayer?.release() - mMediaPlayer = null - }.start() + mMediaPlayer?.setSurface(null) + mMediaPlayer?.release() + mMediaPlayer = null } private fun videoPrepared(mediaPlayer: MediaPlayer) {