From 07afc01354250b5d6de8c5d99366bbf06f477806 Mon Sep 17 00:00:00 2001 From: Raymond Yang Date: Thu, 9 Mar 2023 14:48:25 +0800 Subject: [PATCH] =?UTF-8?q?releaseSurface=E3=80=81pause=E5=8A=A0=E4=B8=8Ai?= =?UTF-8?q?sInit=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/hisharp/gstreamer_player/GstLibrary.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt b/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt index a67e252..eb6cdfc 100644 --- a/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt +++ b/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt @@ -32,7 +32,7 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback { } fun pause() { - //if (!isInit) return + if (!isInit) return nativePause() } @@ -46,6 +46,7 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback { } fun releaseSurface() { + if (!isInit) return isInit = false nativeSurfaceFinalize() }