[vlc-commits] text_renderer: freetype: don't override custom region sar (fix #18195)
Francois Cartegnie
git at videolan.org
Wed Apr 5 19:29:59 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Apr 5 19:28:19 2017 +0200| [cfd849f0e318a458c7734e4e0cf71516078876fc] | committer: Francois Cartegnie
text_renderer: freetype: don't override custom region sar (fix #18195)
regression with on grid layout using 3:4
151e802223b18ae3ebf2e25264a17727e8143058
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cfd849f0e318a458c7734e4e0cf71516078876fc
---
modules/text_renderer/freetype/freetype.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index 582eb5d..823dbd0 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -424,6 +424,8 @@ static int RenderYUVP( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_visible_width = p_bbox->xMax - p_bbox->xMin + 4;
fmt.i_height =
fmt.i_visible_height = p_bbox->yMax - p_bbox->yMin + 4;
+ const unsigned regionnum = p_region->fmt.i_sar_num;
+ const unsigned regionden = p_region->fmt.i_sar_den;
fmt.i_sar_num = fmt.i_sar_den = 1;
assert( !p_region->p_picture );
@@ -432,6 +434,8 @@ static int RenderYUVP( filter_t *p_filter, subpicture_region_t *p_region,
return VLC_EGENERIC;
fmt.p_palette = p_region->fmt.p_palette ? p_region->fmt.p_palette : malloc(sizeof(*fmt.p_palette));
p_region->fmt = fmt;
+ fmt.i_sar_num = regionnum;
+ fmt.i_sar_den = regionden;
/* Calculate text color components
* Only use the first color */
@@ -825,12 +829,17 @@ static inline int RenderAXYZ( filter_t *p_filter,
fmt.i_visible_width = i_text_width + 2 * i_margin;
fmt.i_height =
fmt.i_visible_height = i_text_height + 2 * i_margin;
+ const unsigned regionnum = p_region->fmt.i_sar_num;
+ const unsigned regionden = p_region->fmt.i_sar_den;
fmt.i_sar_num = fmt.i_sar_den = 1;
picture_t *p_picture = p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
+
p_region->fmt = fmt;
+ p_region->fmt.i_sar_num = regionnum;
+ p_region->fmt.i_sar_den = regionden;
/* Initialize the picture background */
const text_style_t *p_style = p_filter->p_sys->p_default_style;
More information about the vlc-commits
mailing list