[vlc-commits] Text Renderers: move to text_segment

Jean-Baptiste Kempf git at videolan.org
Tue Jul 28 16:01:57 CEST 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Apr  6 20:30:01 2015 +0200| [a8d8ce84570fe1490bd034cf522e2040af83afd7] | committer: Jean-Baptiste Kempf

Text Renderers: move to text_segment

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/text_renderer/freetype.c  |    6 +++---
 modules/text_renderer/svg.c       |    3 ++-
 modules/text_renderer/win32text.c |    5 +++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 2773779..a711b5f 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -923,11 +923,11 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
         return VLC_EGENERIC;
     if( b_html && !p_region_in->psz_html )
         return VLC_EGENERIC;
-    if( !b_html && !p_region_in->psz_text )
+    if( !b_html && !p_region_in->p_text && !p_region_in->p_text->psz_text )
         return VLC_EGENERIC;
 
     const size_t i_text_max = strlen( b_html ? p_region_in->psz_html
-                                             : p_region_in->psz_text );
+                                             : p_region_in->p_text->psz_text );
 
     uni_char_t *psz_text = calloc( i_text_max, sizeof( *psz_text ) );
     text_style_t **pp_styles = calloc( i_text_max, sizeof( *pp_styles ) );
@@ -1041,7 +1041,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
                                    psz_text,
                                    pp_styles,
                                    NULL,
-                                   p_region_in->psz_text, p_style, 0 );
+                                   p_region_in->p_text->psz_text, p_style, 0 );
     }
 
     if( !rv && i_text_length > 0 )
diff --git a/modules/text_renderer/svg.c b/modules/text_renderer/svg.c
index 49f0557..00580db 100644
--- a/modules/text_renderer/svg.c
+++ b/modules/text_renderer/svg.c
@@ -435,7 +435,8 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 
     /* Sanity check */
     if( !p_region_in || !p_region_out ) return VLC_EGENERIC;
-    psz_string = p_region_in->psz_text;
+    if( !p_region_in->p_text ) return VLC_EGENERIC;
+    psz_string = p_region_in->p_text->psz_text;
     if( !psz_string || !*psz_string ) return VLC_EGENERIC;
 
     p_svg = malloc( sizeof( svg_rendition_t ) );
diff --git a/modules/text_renderer/win32text.c b/modules/text_renderer/win32text.c
index 84dfe9f..3b04427 100644
--- a/modules/text_renderer/win32text.c
+++ b/modules/text_renderer/win32text.c
@@ -311,10 +311,11 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 
     /* Sanity check */
     if( !p_region_in || !p_region_out ) return VLC_EGENERIC;
-    if( !p_region_in->psz_text || !*p_region_in->psz_text )
+    if( !p_region_in->p_text ) return VLC_EGENERIC;
+    if( !p_region_in->p_text->psz_text || !*p_region_in->p_text->psz_text )
         return VLC_EGENERIC;
 
-    psz_string = ToT(p_region_in->psz_text);
+    psz_string = ToT(p_region_in->p_text->psz_text);
     if( psz_string == NULL )
         return VLC_EGENERIC;
     if( !*psz_string )



More information about the vlc-commits mailing list