[vlc-devel] [PATCH 2/2] Android vout: Correctly clear SPU regions when Close() is called

hackndo hackndo at gmail.com
Tue Oct 27 17:48:34 CET 2015


From: Romain Bentz <bentz.romain at gmail.com>

Previously, when Close() was called, SPU region were not properly cleared.
---
 modules/video_output/android/android_window.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/video_output/android/android_window.c b/modules/video_output/android/android_window.c
index 181a786..7ccacfb 100644
--- a/modules/video_output/android/android_window.c
+++ b/modules/video_output/android/android_window.c
@@ -50,6 +50,7 @@
 #define CFG_PREFIX "androidwindow-"
 static int  Open (vlc_object_t *);
 static void Close(vlc_object_t *);
+static void SubpicturePrepare(vout_display_t *vd, subpicture_t *subpicture);
 
 vlc_module_begin()
     set_category(CAT_VIDEO)
@@ -761,6 +762,15 @@ static void Close(vlc_object_t *p_this)
     if (!sys)
         return;
 
+    /* Check if SPU regions have been properly cleared, and clear them if they
+     * were not. */
+    if (sys->b_has_subpictures)
+    {
+        SubpicturePrepare(vd, NULL);
+        if (sys->b_sub_pic_locked)
+            AndroidWindow_UnlockPicture(sys, sys->p_sub_window, sys->p_sub_pic, true);
+    }
+
     if (sys->pool)
         picture_pool_Release(sys->pool);
     if (sys->p_window)
-- 
2.4.9 (Apple Git-60)



More information about the vlc-devel mailing list