[vlc-devel] [PATCH] Don't call the legacy Freetype background renderer if the EIA-608 bg render feature is used.

Devin Heitmueller dheitmueller at kernellabs.com
Fri Jan 11 20:28:04 CET 2013


If we're using the new background renderer which just renders the
background under the text (instead of the entire subpicture block),
then don't call the legacy render as well.  This prevents a alpha-
transparent box from being shown when rendering EIA-608 captions
if the user has the Freetype background opacity set to a nonzero
value.
---
 modules/text_renderer/freetype.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 5070462..99fa521 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1177,13 +1177,15 @@ static inline int RenderAXYZ( filter_t *p_filter,
     /* Initialize the picture background */
     uint8_t i_a = p_sys->i_background_opacity;
     uint8_t i_x, i_y, i_z;
-    ExtractComponents( p_sys->i_background_color, &i_x, &i_y, &i_z );
-
-    FillPicture( p_picture, i_a, i_x, i_y, i_z );
 
     if (p_region->b_renderbg) {
+        /* Render the background just under the text */
         RenderBackground(p_region, p_line_head, p_bbox, i_margin, p_picture, i_text_width,
                          ExtractComponents, BlendPixel);
+    } else {
+        /* Render background under entire subpicture block */
+        ExtractComponents( p_sys->i_background_color, &i_x, &i_y, &i_z );
+        FillPicture( p_picture, i_a, i_x, i_y, i_z );
     }
 
     /* Render shadow then outline and then normal glyphs */
-- 
1.7.9.5




More information about the vlc-devel mailing list