[vlc-commits] vout/android: clear surfaces only when needed

Thomas Guillem git at videolan.org
Thu Apr 20 15:10:33 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Apr 20 14:29:21 2017 +0200| [1e9030d2f39138c666506e755fbe25d658f01ef0] | committer: Thomas Guillem

vout/android: clear surfaces only when needed

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

 modules/video_output/android/display.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 8161f6e1c3..635617a913 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -127,6 +127,7 @@ struct vout_display_sys_t
     android_window *p_window;
     android_window *p_sub_window;
 
+    bool b_displayed;
     bool b_sub_invalid;
     filter_t *p_spu_blend;
     picture_t *p_sub_pic;
@@ -857,7 +858,8 @@ static void Close(vlc_object_t *p_this)
 
     if (sys->p_window)
     {
-        ClearSurface(vd);
+        if (sys->b_displayed)
+            ClearSurface(vd);
         AndroidWindow_Destroy(vd, sys->p_window);
     }
 
@@ -1159,6 +1161,8 @@ static void Display(vout_display_t *vd, picture_t *picture,
 
     if (subpicture)
         subpicture_Delete(subpicture);
+
+    sys->b_displayed = true;
 }
 
 static void CopySourceAspect(video_format_t *p_dest,



More information about the vlc-commits mailing list