[vlc-commits] Freetype: create an xml_reader helper

Jean-Baptiste Kempf git at videolan.org
Sun Dec 15 14:42:08 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Dec 15 14:34:14 2013 +0100| [e1b3e5a934cad2420a3795f1e4fccf28922fa3ed] | committer: Jean-Baptiste Kempf

Freetype: create an xml_reader helper

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

 modules/text_renderer/freetype.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 437c29e..a72d433 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1966,6 +1966,18 @@ static int ProcessLines( filter_t *p_filter,
     return VLC_SUCCESS;
 }
 
+static xml_reader_t *GetXMLReader( filter_t *p_filter, stream_t *p_sub )
+{
+    xml_reader_t *p_xml_reader = p_filter->p_sys->p_xml;
+    if( !p_xml_reader )
+        p_xml_reader = xml_ReaderCreate( p_filter, p_sub );
+    else
+        p_xml_reader = xml_ReaderReset( p_xml_reader, p_sub );
+    p_filter->p_sys->p_xml = p_xml_reader;
+
+    return p_xml_reader;
+}
+
 /**
  * This function renders a text subpicture region into another one.
  * It also calculates the size needed for this string, and renders the
@@ -2022,12 +2034,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
             return VLC_SUCCESS;
         }
 
-        xml_reader_t *p_xml_reader = p_filter->p_sys->p_xml;
-        if( !p_xml_reader )
-            p_xml_reader = xml_ReaderCreate( p_filter, p_sub );
-        else
-            p_xml_reader = xml_ReaderReset( p_xml_reader, p_sub );
-        p_filter->p_sys->p_xml = p_xml_reader;
+        xml_reader_t *p_xml_reader = GetXMLReader( p_filter, p_sub );
 
         if( !p_xml_reader )
             rv = VLC_EGENERIC;



More information about the vlc-commits mailing list