summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-04-13 20:48:11 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-04-13 20:48:11 +0200
commita22e1e14c8b7e33dea182376bb32b77079e3317d (patch)
tree8148e75538b1386d8cadf0f9041d6e4ddafaf048 /src
parent03918189506c443594f325a836b54220d36bb5a1 (diff)
downloadxine-lib-a22e1e14c8b7e33dea182376bb32b77079e3317d.tar.gz
xine-lib-a22e1e14c8b7e33dea182376bb32b77079e3317d.tar.bz2
Add a global handle for libxdg-basedir library to xine_s.
This handle can then be used by all plugins and other parts of the xine engine without having to duplicate it.
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/Makefile.am17
-rw-r--r--src/xine-engine/xine.c7
-rw-r--r--src/xine-engine/xine_internal.h4
3 files changed, 24 insertions, 4 deletions
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am
index ecd1968f2..9db9f51ec 100644
--- a/src/xine-engine/Makefile.am
+++ b/src/xine-engine/Makefile.am
@@ -1,7 +1,18 @@
include $(top_srcdir)/misc/Makefile.common
include $(top_srcdir)/lib/Makefile.common
-AM_CFLAGS = $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(VISIBILITY_FLAG)
+if !EXTERNAL_LIBXDG_BASEDIR
+link_libxdg_basedir = $(top_builddir)/contrib/libxdg-basedir/libxdg-basedir.la
+cflags_libxdg_basedir = -I$(top_srcdir)/contrib/libxdg-basedir
+
+$(top_builddir)/contrib/libxdg-basedir/libxdg-basedir.la:
+ $(MAKE) -C $(top_builddir)/contrib/libxdg-basedir
+else
+link_libxdg_basedir = $(XDG_BASEDIR_LIBS)
+cflags_libxdg_basedir = $(XDG_BASEDIR_CFLAGS)
+endif
+
+AM_CFLAGS = $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(cflags_libxdg_basedir) $(VISIBILITY_FLAG)
AM_CPPFLAGS = $(ZLIB_CPPFLAGS) -DXINE_LIBRARY_COMPILE
LIBTOOL = $(SHELL) $(top_builddir)/libtool
@@ -24,11 +35,11 @@ libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \
# FIXME: these are currently unused:
EXTRA_DIST = lrb.c lrb.h accel_xvmc.h
-libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) \
+libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(link_libxdg_basedir) \
$(pthread_dep) $(LIBXINEPOSIX)
libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) \
-lm $(XINEUTILS_LIB) $(LIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \
- $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS)
+ $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS) $(link_libxdg_basedir)
libxine_la_LDFLAGS = \
-version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE) \
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index f49a988c9..402aaec66 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -47,6 +47,8 @@
#include <locale.h>
#endif
+#include <basedir.h>
+
#define LOG_MODULE "xine"
#define LOG_VERBOSE
/*
@@ -1410,6 +1412,8 @@ void xine_exit (xine_t *this) {
WSACleanup();
#endif
+ xdgFreeHandle(this->basedir_handle);
+
free (this);
}
@@ -1538,6 +1542,9 @@ void xine_init (xine_t *this) {
static const char *demux_strategies[] = {"default", "reverse", "content",
"extension", NULL};
+ /* First of all, initialise libxdg-basedir as it's used by plugins. */
+ this->basedir_handle = xdgAllocHandle();
+
/* initialize color conversion tables and functions */
init_yuv_conversion();
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index cca3108ce..4231b33ca 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -72,7 +72,6 @@ extern "C" {
# include <xine/alphablend.h>
#endif
-
#define XINE_MAX_EVENT_LISTENERS 50
#define XINE_MAX_EVENT_TYPES 100
@@ -116,6 +115,9 @@ struct xine_s {
metronom_clock_t *clock;
+ /** Handle for libxdg-basedir functions. It's actually an xdgHandle. */
+ void * basedir_handle;
+
#ifdef XINE_ENGINE_INTERNAL
xine_ticket_t *port_ticket;
pthread_mutex_t log_lock;