[vlc-commits] android: AWindowHandler_releaseSurface now release the ANativeWindow

Thomas Guillem git at videolan.org
Fri Jul 31 14:32:41 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 31 10:26:04 2015 +0200| [08e519a420d3100d23207401591ca4374fa2e615] | committer: Thomas Guillem

android: AWindowHandler_releaseSurface now release the ANativeWindow

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08e519a420d3100d23207401591ca4374fa2e615
---

 modules/codec/omxil/mediacodec.c     |    3 ---
 modules/video_output/android/utils.c |    4 +---
 modules/video_output/android/utils.h |    3 ++-
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index c305084..d63907b 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -431,10 +431,7 @@ static void StopMediaCodec(decoder_t *p_dec)
 
     p_sys->api->stop(p_sys->api);
     if (p_dec->fmt_in.i_cat == VIDEO_ES && p_sys->u.video.p_awh)
-    {
-        AWindowHandler_releaseANativeWindow(p_sys->u.video.p_awh, AWindow_Video);
         AWindowHandler_releaseSurface(p_sys->u.video.p_awh, AWindow_Video);
-    }
 }
 
 /*****************************************************************************
diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index 0b36952..30ee92c 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -514,6 +514,7 @@ static void
 AWindowHandler_releaseSurfaceEnv(AWindowHandler *p_awh, JNIEnv *p_env,
                                  enum AWindow_ID id)
 {
+    AWindowHandler_releaseANativeWindow(p_awh, id);
     if (p_awh->views[id].jsurface)
     {
         (*p_env)->DeleteGlobalRef(p_env, p_awh->views[id].jsurface);
@@ -526,9 +527,6 @@ AWindowHandler_destroy(AWindowHandler *p_awh)
 {
     JNIEnv *p_env = AWindowHandler_getEnv(p_awh);
 
-    AWindowHandler_releaseANativeWindow(p_awh, AWindow_Video);
-    AWindowHandler_releaseANativeWindow(p_awh, AWindow_Subtitles);
-
     if (p_env)
     {
         if (p_awh->event.b_registered)
diff --git a/modules/video_output/android/utils.h b/modules/video_output/android/utils.h
index 8de2235..956f5e2 100644
--- a/modules/video_output/android/utils.h
+++ b/modules/video_output/android/utils.h
@@ -148,7 +148,8 @@ void AWindowHandler_releaseSurface(AWindowHandler *p_awh, enum AWindow_ID id);
 /**
  * This function returns the Video or the Subtitles ANativeWindow attached to
  * the Android Surface. It can be released with
- * AWindowHandler_releaseANativeWindow or by AWindowHandler_destroy.
+ * AWindowHandler_releaseANativeWindow, AWindowHandler_releaseSurface or by
+ * AWindowHandler_destroy.
  */
 ANativeWindow *AWindowHandler_getANativeWindow(AWindowHandler *p_awh,
                                                enum AWindow_ID id);



More information about the vlc-commits mailing list