[vlc-commits] codec: cc/substext: remove late flags on update

Francois Cartegnie git at videolan.org
Thu Sep 28 19:30:18 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 28 18:39:36 2017 +0200| [21a6d0337cc1a32655338d2973d97229db73ebbe] | committer: Francois Cartegnie

codec: cc/substext: remove late flags on update

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

 modules/codec/cc.c       | 8 +++++++-
 modules/codec/substext.h | 7 -------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 56d9343a31..65eb3c86fe 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -443,11 +443,13 @@ static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, mtime_t i_pts )
 
     subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
 
+    /* Set first region defaults */
     /* The "leavetext" alignment is a special mode where the subpicture
        region itself gets aligned, but the text inside it does not */
-    p_spu_sys->region.align = SUBPICTURE_ALIGN_TOP;
+    p_spu_sys->region.align = SUBPICTURE_ALIGN_TOP|SUBPICTURE_ALIGN_LEFT;
     p_spu_sys->region.inner_align = SUBPICTURE_ALIGN_LEAVETEXT;
     p_spu_sys->region.flags = UPDT_REGION_IGNORE_BACKGROUND | UPDT_REGION_USES_GRID_COORDINATES;
+
     /* Set style defaults (will be added to segments if none set) */
     p_spu_sys->p_default_style->i_style_flags |= STYLE_MONOSPACED;
     if( p_dec->p_sys->b_opaque )
@@ -1155,6 +1157,10 @@ static void Eia608FillUpdaterRegions( subpicture_updater_sys_t *p_updater, eia60
                     text_segment_ChainDelete( p_segments );
                     return;
                 }
+                /* Copy defaults */
+                p_newregion->align = p_region->align;
+                p_newregion->inner_align = p_region->inner_align;
+                p_newregion->flags = p_region->flags;
                 SubpictureUpdaterSysRegionAdd( p_region, p_newregion );
                 p_region = p_newregion;
                 pp_last = &p_region->p_segments;
diff --git a/modules/codec/substext.h b/modules/codec/substext.h
index 076f42b701..d9aeafb478 100644
--- a/modules/codec/substext.h
+++ b/modules/codec/substext.h
@@ -164,13 +164,6 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
         r->b_noregionbg = p_updtregion->flags & UPDT_REGION_IGNORE_BACKGROUND;
         r->b_gridmode = p_updtregion->flags & UPDT_REGION_USES_GRID_COORDINATES;
 
-        if( r->b_gridmode )
-        {
-            /* Ensure correct flags are set */
-            r->i_align &= ~(SUBPICTURE_ALIGN_RIGHT | SUBPICTURE_ALIGN_BOTTOM);
-            r->i_align |= (SUBPICTURE_ALIGN_LEFT | SUBPICTURE_ALIGN_TOP);
-        }
-
         if (!(p_updtregion->flags & UPDT_REGION_FIX_DONE))
         {
             const float margin_ratio = sys->margin_ratio;



More information about the vlc-commits mailing list