From 7b2a181942ecc07eda4b7dd65eb5e9b08109b265 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 24 Jul 2018 13:09:14 +0200 Subject: [PATCH] use a background thread for setting video surface --- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 27342d095..0cfeec9f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -506,7 +506,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } override fun onSurfaceTextureAvailable(surface: SurfaceTexture?, width: Int, height: Int) { - mExoPlayer?.setVideoSurface(Surface(mTextureView!!.surfaceTexture)) + Thread { + mExoPlayer?.setVideoSurface(Surface(mTextureView!!.surfaceTexture)) + }.start() } @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)