[vlc-commits] quartz: remove unused XML validator
Rémi Denis-Courmont
git at videolan.org
Thu Jul 2 20:12:51 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 2 20:56:25 2015 +0300| [39c3f27b758c5bfe8af0de8a129942c1abaafc0d] | committer: Rémi Denis-Courmont
quartz: remove unused XML validator
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=39c3f27b758c5bfe8af0de8a129942c1abaafc0d
---
modules/text_renderer/quartztext.c | 72 +++++++++++++++++-------------------
1 file changed, 33 insertions(+), 39 deletions(-)
diff --git a/modules/text_renderer/quartztext.c b/modules/text_renderer/quartztext.c
index 3b8e6ca..c36b59a 100644
--- a/modules/text_renderer/quartztext.c
+++ b/modules/text_renderer/quartztext.c
@@ -794,7 +794,6 @@ static int RenderHtml(filter_t *p_filter, subpicture_region_t *p_region_out,
{
int rv = VLC_SUCCESS;
stream_t *p_sub = NULL;
- xml_t *p_xml = NULL;
xml_reader_t *p_xml_reader = NULL;
VLC_UNUSED(p_chroma_list);
@@ -809,56 +808,51 @@ static int RenderHtml(filter_t *p_filter, subpicture_region_t *p_region_out,
strlen(p_region_in->psz_html),
true);
if (p_sub) {
- p_xml = xml_Create(p_filter);
- if (p_xml) {
- p_xml_reader = xml_ReaderCreate(p_xml, p_sub);
- if (p_xml_reader) {
- /* Look for Root Node */
- const char *name;
- if (xml_ReaderNextNode(p_xml_reader, &name)
- == XML_READER_STARTELEM) {
- if (!strcasecmp("karaoke", name)) {
- /* We're going to have to render the text a number
- * of times to show the progress marker on the text.
- */
- var_SetBool(p_filter, "text-rerender", true);
- } else if (strcasecmp("text", name)) {
- /* Only text and karaoke tags are supported */
- msg_Dbg(p_filter, "Unsupported top-level tag "
- "<%s> ignored.", name);
- rv = VLC_EGENERIC;
- }
- } else {
- msg_Err(p_filter, "Malformed HTML subtitle");
+ p_xml_reader = xml_ReaderCreate(p_filter, p_sub);
+ if (p_xml_reader) {
+ /* Look for Root Node */
+ const char *name;
+ if (xml_ReaderNextNode(p_xml_reader, &name)
+ == XML_READER_STARTELEM) {
+ if (!strcasecmp("karaoke", name)) {
+ /* We're going to have to render the text a number
+ * of times to show the progress marker on the text. */
+ var_SetBool(p_filter, "text-rerender", true);
+ } else if (strcasecmp("text", name)) {
+ /* Only text and karaoke tags are supported */
+ msg_Dbg(p_filter, "Unsupported top-level tag "
+ "<%s> ignored.", name);
rv = VLC_EGENERIC;
}
+ } else {
+ msg_Err(p_filter, "Malformed HTML subtitle");
+ rv = VLC_EGENERIC;
+ }
- if (rv != VLC_SUCCESS) {
- xml_ReaderDelete(p_xml_reader);
- p_xml_reader = NULL;
- }
+ if (rv != VLC_SUCCESS) {
+ xml_ReaderDelete(p_xml_reader);
+ p_xml_reader = NULL;
}
+ }
- if (p_xml_reader) {
- int i_len;
+ if (p_xml_reader) {
+ int i_len;
- CFMutableAttributedStringRef p_attrString = CFAttributedStringCreateMutable(kCFAllocatorDefault, 0);
- rv = ProcessNodes(p_filter, p_xml_reader,
+ CFMutableAttributedStringRef p_attrString = CFAttributedStringCreateMutable(kCFAllocatorDefault, 0);
+ rv = ProcessNodes(p_filter, p_xml_reader,
p_region_in->p_style, p_attrString);
- i_len = CFAttributedStringGetLength(p_attrString);
+ i_len = CFAttributedStringGetLength(p_attrString);
- p_region_out->i_x = p_region_in->i_x;
- p_region_out->i_y = p_region_in->i_y;
+ p_region_out->i_x = p_region_in->i_x;
+ p_region_out->i_y = p_region_in->i_y;
- if ((rv == VLC_SUCCESS) && (i_len > 0))
- RenderYUVA(p_filter, p_region_out, p_attrString);
+ if ((rv == VLC_SUCCESS) && (i_len > 0))
+ RenderYUVA(p_filter, p_region_out, p_attrString);
- CFRelease(p_attrString);
+ CFRelease(p_attrString);
- xml_ReaderDelete(p_xml_reader);
- }
- xml_Delete(p_xml);
+ xml_ReaderDelete(p_xml_reader);
}
stream_Delete(p_sub);
}
More information about the vlc-commits
mailing list