From: RĂ©mi Denis-Courmont Date: Thu, 5 Aug 2010 15:55:57 +0000 (+0300) Subject: skins2: don't load XML catalog if DTD not requested X-Git-Tag: 1.2.0-pre1~5549 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=49b4824b37e23995ef9c7eb46a8aba427a4fad19;p=vlc skins2: don't load XML catalog if DTD not requested Also don't fail if the XML validator cannot be loaded. --- diff --git a/modules/gui/skins2/parser/xmlparser.cpp b/modules/gui/skins2/parser/xmlparser.cpp index f45dc0ffd0..ca287da27f 100644 --- a/modules/gui/skins2/parser/xmlparser.cpp +++ b/modules/gui/skins2/parser/xmlparser.cpp @@ -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 );