]> git.sesse.net Git - vlc/commitdiff
skins2: don't load XML catalog if DTD not requested
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 5 Aug 2010 15:55:57 +0000 (18:55 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 5 Aug 2010 15:55:57 +0000 (18:55 +0300)
Also don't fail if the XML validator cannot be loaded.

modules/gui/skins2/parser/xmlparser.cpp

index f45dc0ffd00272d2181ef7bded84a2515bb7a020..ca287da27f95484e2f8d27f3ba838bcbfa26dd0f 100644 (file)
@@ -39,21 +39,19 @@ XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName,
     m_pReader = NULL;
     m_pStream = NULL;
 
-    m_pXML = xml_Create( pIntf );
-    if( !m_pXML )
+    if( useDTD )
     {
-        msg_Err( getIntf(), "failed to open XML parser" );
-        return;
+        m_pXML = xml_Create( pIntf );
+        if( m_pXML )
+            LoadCatalog();
+        else
+        {
+            msg_Err( getIntf(), "DTD not supported" );
+            useDTD = false;
+        }
     }
-
-    // Avoid duplicate initialization (mutex needed ?) -> doesn't work
-    // Reinitialization required for a new XMLParser
-    // if( !m_initialized )
-    // {
-    //    LoadCatalog();
-    //    m_initialized = true;
-    // }
-    LoadCatalog();
+    else
+        m_pXML = NULL;
 
     char* psz_uri = make_URI( rFileName.c_str(), NULL );
     m_pStream = stream_UrlNew( pIntf, psz_uri );