[vlc-commits] android_window: clear the video surface when closing

Thomas Guillem git at videolan.org
Wed Oct 5 12:16:26 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Oct  5 11:55:47 2016 +0200| [810a890dc73c9a06dfaa653005d4157b3b89b9d6] | committer: Thomas Guillem

android_window: clear the video surface when closing

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

 modules/video_output/android/android_window.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/android/android_window.c b/modules/video_output/android/android_window.c
index e95df93..03e51ef 100644
--- a/modules/video_output/android/android_window.c
+++ b/modules/video_output/android/android_window.c
@@ -328,14 +328,15 @@ static void SetupPictureYV12(picture_t *p_picture, uint32_t i_in_stride)
 }
 
 static void AndroidWindow_DisconnectSurface(vout_display_sys_t *sys,
-                                            android_window *p_window)
+                                            android_window *p_window,
+                                            bool b_clear)
 {
     if (p_window->p_handle_priv) {
         sys->anwp->disconnect(p_window->p_handle_priv);
         p_window->p_handle_priv = NULL;
     }
     if (p_window->p_handle) {
-        AWindowHandler_releaseANativeWindow(sys->p_awh, p_window->id, false);
+        AWindowHandler_releaseANativeWindow(sys->p_awh, p_window->id, b_clear);
         p_window->p_handle = NULL;
     }
 }
@@ -411,9 +412,9 @@ error:
 }
 
 static void AndroidWindow_Destroy(vout_display_t *vd,
-                                  android_window *p_window)
+                                  android_window *p_window, bool b_clear)
 {
-    AndroidWindow_DisconnectSurface(vd->sys, p_window);
+    AndroidWindow_DisconnectSurface(vd->sys, p_window, b_clear);
     free(p_window);
 }
 
@@ -500,7 +501,7 @@ static int AndroidWindow_ConfigureJavaSurface(vout_display_sys_t *sys,
                                           p_window->i_android_hal) == VLC_SUCCESS)
     {
         *p_java_configured = true;
-        AndroidWindow_DisconnectSurface(sys, p_window);
+        AndroidWindow_DisconnectSurface(sys, p_window, false);
         if (AndroidWindow_ConnectSurface(sys, p_window) != 0)
             return -1;
     } else
@@ -774,7 +775,7 @@ static void Close(vlc_object_t *p_this)
     if (sys->pool)
         picture_pool_Release(sys->pool);
     if (sys->p_window)
-        AndroidWindow_Destroy(vd, sys->p_window);
+        AndroidWindow_Destroy(vd, sys->p_window, true);
 
     if (sys->p_sub_pic)
         picture_Release(sys->p_sub_pic);
@@ -782,7 +783,7 @@ static void Close(vlc_object_t *p_this)
         filter_DeleteBlend(sys->p_spu_blend);
     free(sys->p_sub_buffer_bounds);
     if (sys->p_sub_window)
-        AndroidWindow_Destroy(vd, sys->p_sub_window);
+        AndroidWindow_Destroy(vd, sys->p_sub_window, false);
 
     if (sys->p_awh)
         AWindowHandler_destroy(sys->p_awh);



More information about the vlc-commits mailing list