Commit e1b3e5a9 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Freetype: create an xml_reader helper

parent f20218fa
...@@ -1966,6 +1966,18 @@ static int ProcessLines( filter_t *p_filter, ...@@ -1966,6 +1966,18 @@ static int ProcessLines( filter_t *p_filter,
return VLC_SUCCESS; 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. * This function renders a text subpicture region into another one.
* It also calculates the size needed for this string, and renders the * 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, ...@@ -2022,12 +2034,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
xml_reader_t *p_xml_reader = p_filter->p_sys->p_xml; xml_reader_t *p_xml_reader = GetXMLReader( p_filter, p_sub );
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;
if( !p_xml_reader ) if( !p_xml_reader )
rv = VLC_EGENERIC; rv = VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment