[vlc-devel] [PATCH 2/2] Android vout: Correctly clear SPU regions on resolution change

hackndo hackndo at gmail.com
Tue Oct 27 17:15:12 CET 2015


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

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

diff --git a/modules/video_output/android/android_window.c b/modules/video_output/android/android_window.c
index 181a786..e37896a 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,17 @@ 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.
+     * Indeed when leaving a menu on a DVD, resolution changes and Close() is
+     * called even if last SPU region wasn't cleared. */
+    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