AC_ARG_ENABLE(libxml2,
[ --enable-libxml2 libxml2 support (default enabled)])
AS_IF([test "${enable_libxml2}" != "no"], [
- PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.5 libxml-2.0 < 2.7], [
+ PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.5], [
VLC_ADD_CPPFLAGS([xml],[${XML2_CFLAGS}])
VLC_ADD_LIBS([xml],[${XML2_LIBS}])
VLC_ADD_PLUGIN([xml])
], [
AS_IF([test "x${enable_xml2}" != "x"], [
- AC_MSG_ERROR([Could not find libxml version 2.5 or 2.6])
+ AC_MSG_ERROR([Could not find libxml version 2.5 or higher])
])
])
])
#include <libxml/xmlreader.h>
#include <libxml/catalog.h>
-#if !defined (LIBXML_VERSION) || (LIBXML_VERSION > 20700)
-# error Stale config.cache detected. Erase it and re-run configure.
-#endif
-
/*****************************************************************************
* Module descriptor
*****************************************************************************/
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;
/*****************************************************************************
return VLC_EGENERIC;
vlc_mutex_lock( &lock );
- if( refs++ == 0 )
- xmlInitParser();
+ xmlInitParser();
vlc_mutex_unlock( &lock );
p_xml->pf_reader_create = ReaderCreate;
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
+#ifdef LIBXML_GETS_A_CLUE_ABOUT_REENTRANCY_AND_MEMORY_LEAKS
vlc_mutex_lock( &lock );
- if( --refs == 0 )
- xmlCleanupParser();
+ xmlCleanupParser();
vlc_mutex_unlock( &lock );
-
+#endif
VLC_UNUSED(p_this);
return;
}