]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/parser/xmlparser.cpp
skins2: remove unused static variable
[vlc] / modules / gui / skins2 / parser / xmlparser.cpp
index f45dc0ffd00272d2181ef7bded84a2515bb7a020..fea743a56c6565fc6cfd3ca2bb2453c70923c44a 100644 (file)
@@ -29,9 +29,6 @@
 #   include <sys/stat.h>
 #endif
 
-// Static variable to avoid initializing catalogs twice
-static bool m_initialized = false;
-
 XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName,
                       bool useDTD ):
     SkinObject( pIntf )
@@ -39,21 +36,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 );