[vlc-commits] cea708: Fix support for rendering of multiple windows

Devin Heitmueller git at videolan.org
Sat Jan 26 00:36:19 CET 2019


vlc | branch: master | Devin Heitmueller <dheitmueller at ltnglobal.com> | Wed Jan 23 17:09:10 2019 -0500| [27be2e658a4fcf8462ec800fe86b712c02302c4f] | committer: Jean-Baptiste Kempf

cea708: Fix support for rendering of multiple windows

In the existing code, p_region would always be equal to
p_spu_sys->region, since that is what it is initalized to and
nothing ever changes it.  Hence as the loop iterates, all the
windows will be update the first subpicture region (i.e.
corrupting that region such that it's properties are exclusively
that of the last window in the loop).  The result is only
the last window is ever rendered on-screen.

Add a variable to determine whether to use the original region
or whether to create a new region (so we end up with a different
subpicture region for each window).

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/cea708.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
index c0cea476f7..3af226a6c6 100644
--- a/modules/codec/cea708.c
+++ b/modules/codec/cea708.c
@@ -1049,12 +1049,14 @@ static subpicture_t *CEA708_BuildSubtitle( cea708_t *p_cea708 )
 
     p_spu_sys->margin_ratio = CEA708_SCREEN_SAFE_MARGIN_RATIO;
 
+    bool first = true;
+
     for(size_t i=0; i<CEA708_WINDOWS_COUNT; i++)
     {
         cea708_window_t *p_w = &p_cea708->window[i];
         if( p_w->b_defined && p_w->b_visible && CEA708_Window_RowCount( p_w ) )
         {
-            if( p_region != &p_spu_sys->region )
+            if( !first )
             {
                 substext_updater_region_t *p_newregion =
                         SubpictureUpdaterSysRegionNew();
@@ -1063,6 +1065,8 @@ static subpicture_t *CEA708_BuildSubtitle( cea708_t *p_cea708 )
                 SubpictureUpdaterSysRegionAdd( p_region, p_newregion );
                 p_region = p_newregion;
             }
+            first = false;
+
             /* Fill region */
             CEA708SpuConvert( p_w, p_region );
         }



More information about the vlc-commits mailing list