Browse Source

codec: cc/substext: remove late flags on update

pull/59/merge
Francois Cartegnie 9 years ago
parent
commit
21a6d0337c
  1. 8
      modules/codec/cc.c
  2. 7
      modules/codec/substext.h

8
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;

7
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;

Loading…
Cancel
Save