[vlc-devel] commit: Revert "libxml: fix plugin re-entrancy - refs #2541" ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Feb 20 18:09:09 CET 2009


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Fri Feb 20 19:08:21 2009 +0200| [e94b79b1d2503152a4fdc018e89dfe744ef1218d] | committer: Rémi Denis-Courmont 

Revert "libxml: fix plugin re-entrancy - refs #2541"

Hmm, we lack API support in 0.9, so keep the old crashing behavior.

This reverts commit e54510695e1959508a6ca3a6d064c7e687d870c6.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e94b79b1d2503152a4fdc018e89dfe744ef1218d
---

 modules/misc/xml/libxml.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/modules/misc/xml/libxml.c b/modules/misc/xml/libxml.c
index 96b4e9c..1b25a82 100644
--- a/modules/misc/xml/libxml.c
+++ b/modules/misc/xml/libxml.c
@@ -67,9 +67,6 @@ static void CatalogLoad( xml_t *, const char * );
 static void CatalogAdd( xml_t *, const char *, const char *, const char * );
 static int StreamRead( void *p_context, char *p_buffer, int i_buffer );
 
-static unsigned refs = 0;
-static vlc_mutex_t lock = VLC_STATIC_MUTEX;
-
 /*****************************************************************************
  * Module initialization
  *****************************************************************************/
@@ -77,13 +74,7 @@ static int Open( vlc_object_t *p_this )
 {
     xml_t *p_xml = (xml_t *)p_this;
 
-    if( !xmlHasFeature( XML_WITH_THREAD ) )
-        return VLC_EGENERIC;
-
-    vlc_mutex_lock( &lock );
-    if( refs++ == 0 )
-        xmlInitParser();
-    vlc_mutex_unlock( &lock );
+    xmlInitParser();
 
     p_xml->pf_reader_create = ReaderCreate;
     p_xml->pf_reader_delete = ReaderDelete;
@@ -99,11 +90,7 @@ static int Open( vlc_object_t *p_this )
  *****************************************************************************/
 static void Close( vlc_object_t *p_this )
 {
-    vlc_mutex_lock( &lock );
-    if( --refs == 0 )
-        xmlCleanupParser();
-    vlc_mutex_unlock( &lock );
-
+    xmlCleanupParser();
     VLC_UNUSED(p_this);
     return;
 }




More information about the vlc-devel mailing list