Commit 8a509149 authored by Rafaël Carré's avatar Rafaël Carré Committed by ivoire
Browse files

Update patches


Signed-off-by: ivoire's avatarRémi Duraffort <ivoire@videolan.org>
parent 77858224
From 008d9315aeb6a7a032179a08621af674f70736ec Mon Sep 17 00:00:00 2001
From c83e865b64e50d49cb48ce2391f7ac22ad74d194 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-Philippe=20Andr=C3=A9?= <jpeg@videolan.org>
Date: Thu, 2 Jun 2011 15:15:57 +0200
Subject: [PATCH 1/8] Android: add compatibility pthread_cancel
......@@ -320,11 +320,11 @@ index 0000000..8a39f5d
+ return ret;
+}
diff --git a/configure.ac b/configure.ac
index 3d87a9b..ffcb057 100644
index 9812a53..4060b9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -532,6 +532,10 @@ if test "${SYS}" = "mingw32" -a "${CXX}" != "" ; then
AC_LANG_POP(C++)
@@ -530,6 +530,10 @@ if test "${SYS}" = "mingw32" ; then
CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
fi
+if test "${HAVE_ANDROID}" = "1"; then
......@@ -335,10 +335,10 @@ index 3d87a9b..ffcb057 100644
dnl Buggy glibc prevention. Purposedly not cached.
dnl See sourceware.org bugs 5058 and 5443.
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index a223384..5fcd0d6 100644
index 9ad95f5..81a0d37 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -337,6 +337,28 @@ long nrand48 (unsigned short subi[3]);
@@ -338,6 +338,28 @@ long nrand48 (unsigned short subi[3]);
# undef __cplusplus
# endif
char *tempnam(const char *, const char *);
......@@ -409,7 +409,7 @@ index e3f7051..f6827e7 100644
vlc_mutex_unlock (&lock);
}
diff --git a/src/posix/thread.c b/src/posix/thread.c
index 966c74c..9618fa5 100644
index 9064563..a763591 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -435,7 +435,11 @@ void vlc_cond_broadcast (vlc_cond_t *p_condvar)
......@@ -465,5 +465,5 @@ index 966c74c..9618fa5 100644
pthread_attr_destroy (attr);
return ret;
--
1.7.6
1.7.4.1
From fbdf604a30a47fdc733378e1339f4bd0ac71cf46 Mon Sep 17 00:00:00 2001
From 69c5fa1cf6efe1fcbeabeaebc68d7610bb6755ab Mon Sep 17 00:00:00 2001
From: Dominique Martinet <asmadeus@codewreck.org>
Date: Thu, 2 Jun 2011 12:50:50 +0200
Subject: [PATCH 2/8] Android: use a custom poll(), fixes HTTP playback
......@@ -10,12 +10,12 @@ Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2 files changed, 72 insertions(+), 1 deletions(-)
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 5fcd0d6..d00fa21 100644
index 81a0d37..ed000ef 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -271,7 +271,7 @@ struct pollfd
};
@@ -272,7 +272,7 @@ struct pollfd
#endif
#ifndef HAVE_POLL
# define poll(a, b, c) vlc_poll(a, b, c)
-#elif defined (HAVE_MAEMO)
+#elif defined (HAVE_MAEMO) || defined (__ANDROID__)
......@@ -23,7 +23,7 @@ index 5fcd0d6..d00fa21 100644
# define poll(a, b, c) vlc_poll(a, b, c)
int vlc_poll (struct pollfd *, unsigned, int);
diff --git a/src/network/poll.c b/src/network/poll.c
index c1ca900..46ec3b5 100644
index 24335c2..aa2e260 100644
--- a/src/network/poll.c
+++ b/src/network/poll.c
@@ -60,6 +60,77 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
......@@ -105,5 +105,5 @@ index c1ca900..46ec3b5 100644
# include <vlc_network.h>
--
1.7.6
1.7.4.1
From 64659724f9d7c8edb964488806f817c5651ff37f Mon Sep 17 00:00:00 2001
From acadc50a2b1fcdd598a9df9f7c1e062054221804 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Fri, 10 Jun 2011 16:48:26 +0200
Subject: [PATCH 3/8] No dtv on Android
......@@ -9,10 +9,10 @@ Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/modules/access/Modules.am b/modules/access/Modules.am
index 3183db7..7578d88 100644
index 2db7a4c..080b1e7 100644
--- a/modules/access/Modules.am
+++ b/modules/access/Modules.am
@@ -133,6 +133,7 @@ libdtv_plugin_la_CFLAGS = $(AM_CFLAGS)
@@ -158,6 +158,7 @@ libdtv_plugin_la_CFLAGS = $(AM_CFLAGS)
libdtv_plugin_la_LIBADD = $(AM_LIBADD)
libdtv_plugin_la_DEPENDENCIES =
......@@ -20,7 +20,7 @@ index 3183db7..7578d88 100644
if HAVE_LINUX
libdtv_plugin_la_SOURCES += dtv/linux.c
if HAVE_DVBPSI
@@ -142,6 +143,7 @@ libdtv_plugin_la_LIBADD += $(DVBPSI_LIBS)
@@ -167,6 +168,7 @@ libdtv_plugin_la_LIBADD += $(DVBPSI_LIBS)
endif
libvlc_LTLIBRARIES += libdtv_plugin.la
endif
......@@ -29,5 +29,5 @@ index 3183db7..7578d88 100644
if HAVE_WIN32
# Work-around automake bug:
--
1.7.6
1.7.4.1
From e7954be97f9104f59c2f5eaa28cbe5ad0fc3066c Mon Sep 17 00:00:00 2001
From cfa1e789163b133a82afb0c1c1d9737b18a693db Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Sun, 31 Jul 2011 00:20:40 +0200
Subject: [PATCH 4/8] Push messages to Android stack
---
configure.ac | 1 +
src/misc/messages.c | 21 ++++++++++++++++++++-
src/misc/messages.c | 7 +++++++
src/posix/thread.c | 16 ++++++++++++----
3 files changed, 33 insertions(+), 5 deletions(-)
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index ffcb057..6f302d2 100644
index 4060b9c..31151b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -534,6 +534,7 @@ fi
@@ -532,6 +532,7 @@ fi
if test "${HAVE_ANDROID}" = "1"; then
AC_REPLACE_FUNCS([pthread_cancel])
......@@ -22,53 +22,29 @@ index ffcb057..6f302d2 100644
dnl
diff --git a/src/misc/messages.c b/src/misc/messages.c
index 188d763..96f570a 100644
index 8bc8b16..82aff49 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -434,6 +434,11 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
# define GRAY "\033[0m"
static const char msgtype[4][9] = { "", " error", " warning", " debug" };
static const char msgcolor[4][8] = { WHITE, RED, YELLOW, GRAY };
@@ -224,10 +224,17 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module,
va_list ap;
va_copy (ap, args);
+#ifdef __ANDROID__
+#include <android/log.h>
+ android_LogPriority prioritytype[4] = {ANDROID_LOG_INFO, ANDROID_LOG_ERROR,
+ ANDROID_LOG_WARN, ANDROID_LOG_DEBUG };
+#endif
libvlc_priv_t *priv = libvlc_priv (p_this->p_libvlc);
int type = p_item->i_type;
@@ -469,14 +474,28 @@ static void PrintMsg ( vlc_object_t *p_this, const msg_item_t *p_item )
fprintf (stream, priv->b_color ? "["GREEN"%p"GRAY"] " : "[%p] ",
(void *)p_item->i_object_id);
if (p_item->psz_header != NULL)
+ {
+#ifdef __ANDROID__
+ __android_log_print (prioritytype[type], "vlc", "[%s] ", p_item->psz_header);
+#else
utf8_fprintf (stream, "[%s] ", p_item->psz_header);
- utf8_fprintf (stream, "%s %s%s: ", p_item->psz_module, objtype,
+#endif
+ }
+
+#ifdef __ANDROID__
+ __android_log_print (prioritytype[type], "vlc",
+ "%s %s%s: %s", p_item->psz_module, objtype,
+ msgtype[type], p_item->psz_msg );
+ __android_log_vprint(prioritytype[type], "vlc", format, ap);
+#else
+ utf8_fprintf (stream,
+ "%s %s%s: ", p_item->psz_module, objtype,
msgtype[type]);
if (priv->b_color)
fputs (msgcolor[type], stream);
fputs (p_item->psz_msg, stream);
if (priv->b_color)
fputs (GRAY, stream);
PrintColorMsg (&priv->i_verbose, type, &msg, format, ap);
else
PrintMsg (&priv->i_verbose, type, &msg, format, ap);
+#endif
putc_unlocked ('\n', stream);
#if defined (WIN32) || defined (__OS2__)
fflush (stream);
va_end (ap);
vlc_rwlock_rdlock (&msg_lock);
diff --git a/src/posix/thread.c b/src/posix/thread.c
index 9618fa5..d944fff 100644
index a763591..a898e28 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -136,6 +136,14 @@ static struct timespec mtime_to_ts (mtime_t date)
......@@ -116,5 +92,5 @@ index 9618fa5..d944fff 100644
fflush (stderr);
--
1.7.6
1.7.4.1
From 7b71470c01322fa4710f41493185e95af7436d8b Mon Sep 17 00:00:00 2001
From 3916167843b2c864a54bc47d9066b4b6a271944e Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Sun, 31 Jul 2011 00:05:21 +0200
Subject: [PATCH 07/10] Old contribs: compile live on Android
Subject: [PATCH 5/8] Old contribs: compile live on Android
---
extras/contrib/src/Patches/live-android.patch | 66 +++++++++++++++++++++++++
......@@ -11,7 +11,7 @@ Subject: [PATCH 07/10] Old contribs: compile live on Android
diff --git a/extras/contrib/src/Patches/live-android.patch b/extras/contrib/src/Patches/live-android.patch
new file mode 100644
index 0000000..294b1ef
index 0000000..9133533
--- /dev/null
+++ b/extras/contrib/src/Patches/live-android.patch
@@ -0,0 +1,66 @@
......@@ -96,5 +96,5 @@ index a717c40..99580f0 100644
LIVE_TARGET-$(ENABLED) = linux
LIVE_TARGET-$(HAVE_WIN32) = mingw
--
1.7.6
1.7.4.1
From 1de0f81a2e6d14bbd9f2ece949c25f678bd7f121 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Wed, 6 Jul 2011 00:16:58 +0200
Subject: [PATCH 5/8] Revert "Move common predefined macros to config.h and
common.am"
This reverts commit 7af4b7fed74f000a0145547a301d67314df977d3.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
configure.ac | 6 +-----
modules/common.am | 1 -
src/check_headers | 1 -
src/vlc-plugin.pc.in | 1 +
vlc-config.in.in | 8 ++++++++
5 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6f302d2..a9865ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,11 +59,7 @@ dnl Check for tools
dnl
AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
-AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
-AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
-AC_DEFINE([_REENTRANT],, [Define to expose reentrant functions.])
-AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
-AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
+AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to '2' to get glibc warnings.])
AM_PROG_CC_C_O
AC_PROG_CXX
diff --git a/modules/common.am b/modules/common.am
index 5cecb18..760ac33 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -13,7 +13,6 @@ CLEANFILES = $(BUILT_SOURCES)
LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
-AM_CPPFLAGS = -D__PLUGIN__
AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
diff --git a/src/check_headers b/src/check_headers
index 2167f80..0e13920 100755
--- a/src/check_headers
+++ b/src/check_headers
@@ -8,7 +8,6 @@ cd "$(dirname "$0")" || exit $?
regexp="$(cat ../config.h.in | \
sed -n -e 's/^#undef \([A-Z0-9_]*\)$/\1/p' | \
grep -v 'WORDS_BIGENDIAN' | \
- grep -v '__LIBVLC__' | \
xargs | \
sed -e 's/ /\\\(\\s\\\|$\\\)\\\| /g')"
regexp=" $regexp\$"
diff --git a/src/vlc-plugin.pc.in b/src/vlc-plugin.pc.in
index 61c8880..4afeedc 100644
--- a/src/vlc-plugin.pc.in
+++ b/src/vlc-plugin.pc.in
@@ -15,6 +15,7 @@ Version: @VERSION@
Cflags: -I${includedir} -I${pkgincludedir}/plugins \
-D__PLUGIN__ \
-D_FILE_OFFSET_BITS=64 \
+ -D__USE_UNIX98 \
@DEFS_BIGENDIAN@ \
-D_REENTRANT \
-D_THREAD_SAFE
diff --git a/vlc-config.in.in b/vlc-config.in.in
index 502b61f..2b649c8 100644
--- a/vlc-config.in.in
+++ b/vlc-config.in.in
@@ -36,6 +36,7 @@ Options:
[--objcflags] output Objective C compilation flags
Modules:
vlc the main VLC object
+ plugin flags for plugin modules
MODULE any available module (dummy, gtk, avi, etc.)
libs flags for external libs
BLAH
@@ -65,6 +66,11 @@ cppflags="${includes}"
module=""
#
+# On Linux and Solaris, activate 64-bit off_t (by default under BSD)
+#
+cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE"
+
+#
# Various additional defines
#
if [ "${optim}" = speed ]; then
@@ -145,9 +151,11 @@ while test $# -gt 0; do
usage 1 1>&1
;;
libvlccore)
+ cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
;;
plugin)
echo_plugin=yes
+ cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
;;
*)
module="$tgt"
--
1.7.6
From 77901d9bff3a7748a42d48135e572e3d85662271 Mon Sep 17 00:00:00 2001
From 979638209f42241a0fe806157d3578e749fa675a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Toque?= <xilasz@gmail.com>
Date: Thu, 7 Jul 2011 01:23:53 +0200
Subject: [PATCH 8/8] Old contribs: enable mkv for Android
Subject: [PATCH 6/8] Old contribs: enable mkv for Android
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
......@@ -12,10 +12,10 @@ Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap
index 4db520e..2fcae1a 100755
index 918eb99..5f51e37 100755
--- a/extras/contrib/bootstrap
+++ b/extras/contrib/bootstrap
@@ -362,8 +362,11 @@ case "$DISTRO" in
@@ -360,8 +360,11 @@ case "$DISTRO" in
fi
# The given host (arm-eabi) is not the real one (arm-linux-androideabi)
ln -sfn $TARGET hosts/arm-linux-androideabi
......@@ -29,7 +29,7 @@ index 4db520e..2fcae1a 100755
NM=arm-linux-androideabi-nm
AR=arm-linux-androideabi-ar
LD=arm-linux-androideabi-ld
@@ -374,7 +377,10 @@ case "$DISTRO" in
@@ -372,7 +375,10 @@ case "$DISTRO" in
add_makefile_cfg "PATH = ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
add_enabled_makefile_cfg "HAVE_LINUX"
if test -z "$NO_NEON"; then
......@@ -83,5 +83,5 @@ index 73a8d39..ce4f4a2 100755
--disable-mod \
--disable-sid \
--
1.7.6
1.7.4.1
From 72d782188f36685955692831e2542dcd21e4e89e Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Wed, 6 Jul 2011 00:18:31 +0200
Subject: [PATCH 6/8] Revert "Remove ugly builtin support"
This reverts commit 473a276fdd990c75efe1106a8c7b2de18200df59.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
configure.ac | 24 ++++++++++++++++++++----
include/vlc/libvlc.h | 35 +++++++++++++++++++++++++++++++++++
modules/common.am | 10 +++++-----
src/control/core.c | 11 +++++++++--
src/control/libvlc_internal.h | 2 +-
src/libvlc.c | 4 ++--
src/libvlc.sym | 1 +
src/modules/modules.c | 8 +++++++-
src/modules/modules.h | 6 +++---
9 files changed, 83 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index a9865ae..5d84e06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,6 +96,26 @@ AS_IF([test -n "${with_binary_version}"],[
[Binary specific version])
])
+dnl Check how we are asked to build
+AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
+ AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
+])
+
+AC_ARG_ENABLE(static-modules,
+ [AS_HELP_STRING([--enable-static-modules],
+ [link modules statically - VLC will not work])])
+AS_IF([test "${enable_static_modules}" = yes], [
+ enable_shared="no"
+ enable_static="yes"
+ VLC_DEFAULT_PLUGIN_TYPE="builtin"
+ AS_IF([test "${enable_vlc}" != "no"],
+ [AC_MSG_WARN([Building modules as static. VLC will not work.])])
+], [
+ VLC_DEFAULT_PLUGIN_TYPE="plugin"
+])
+
+AC_SUBST(VLC_DEFAULT_PLUGIN_TYPE)
+
dnl
dnl Check for the contrib directory
dnl
@@ -442,10 +462,6 @@ m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
lt_cv_deplibs_check_method=pass_all
-AS_IF([test "${enable_shared}" = "no"], [
- AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
-])
-
dnl
dnl Gettext stuff
dnl
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index da4d23d..c99e6bf 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -137,6 +137,41 @@ const char *libvlc_printerr (const char *fmt, ...);
LIBVLC_API libvlc_instance_t *
libvlc_new( int argc , const char *const *argv );
+
+/**
+ * \return a static entry point for a module, suitable for passing to
+ * libvlc_new_with_builtins. This is to be used when you want to statically
+ * link to a module.
+ *
+ * Note, statically linking to a module will results in nearly zero speed gain
+ * and increased memory usage. Use with caution.
+ */
+
+#define vlc_plugin(module) & vlc_plugin_entry(module)
+
+#define vlc_plugin_entry(module) vlc_entry__ ## module
+#define vlc_declare_plugin(module) extern void *vlc_plugin_entry(module);
+
+/**
+ * Create and initialize a libvlc instance.
+ *
+ * \param argc the number of arguments
+ * \param argv command-line-type arguments
+ * \param builtins a NULL terminated array of \see vlc_plugin.
+ * \return the libvlc instance or NULL in case of error
+ * @begincode
+ * {
+ * vlc_declare_plugin(mp4);
+ * vlc_declare_plugin(dummy);
+ * const void **builtins = { vlc_plugin(mp4), vlc_plugin(dummy), NULL };
+ * libvlc_instance_t *vlc = libvlc_new_with_builtins(argc, argv, builtins);
+ * }
+ * @endcode
+ */
+LIBVLC_API libvlc_instance_t *
+libvlc_new_with_builtins( int argc , const char *const *argv, const void **builtins);
+
+
/**
* Decrement the reference count of a libvlc instance, and destroy it
* if it reaches zero.
diff --git a/modules/common.am b/modules/common.am
index 760ac33..44765b5 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -13,16 +13,16 @@ CLEANFILES = $(BUILT_SOURCES)
LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
-AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
-AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
-AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
+AM_CFLAGS = `$(VLC_CONFIG) --cflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
+AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
+AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
AM_LDFLAGS = -rpath '$(libvlcdir)' \
-avoid-version -module \
-export-symbols-regex ^vlc_entry \
-shrext $(LIBEXT) \
-no-undefined \
- `$(VLC_CONFIG) --ldflags plugin $@`
-AM_LIBADD = `$(VLC_CONFIG) -libs plugin $@` \
+ `$(VLC_CONFIG) --ldflags $(VLC_DEFAULT_PLUGIN_TYPE) $@`
+AM_LIBADD = `$(VLC_CONFIG) -libs $(VLC_DEFAULT_PLUGIN_TYPE) $@` \
$(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la
include $(srcdir)/Modules.am
diff --git a/src/control/core.c b/src/control/core.c
index 2834af1..c627c0a 100644
--- a/src/control/core.c
+++ b/src/control/core.c
@@ -38,7 +38,8 @@
static const char nomemstr[] = "Insufficient memory";
-libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
+libvlc_instance_t * libvlc_new_with_builtins( int argc, const char *const *argv,
+ const void ** builtins_module)
{
libvlc_instance_t *p_new = malloc (sizeof (*p_new));
if (unlikely(p_new == NULL))
@@ -56,7 +57,7 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
if (unlikely (p_libvlc_int == NULL))
goto error;
- if (libvlc_InternalInit( p_libvlc_int, argc + 1, my_argv ))
+ if (libvlc_InternalInit( p_libvlc_int, argc + 1, my_argv, builtins_module ))
{
libvlc_InternalDestroy( p_libvlc_int );
goto error;
@@ -80,6 +81,12 @@ error:
return NULL;
}
+libvlc_instance_t * libvlc_new( int argc, const char *const *argv)
+{
+ return libvlc_new_with_builtins(argc, argv, NULL);
+}
+
+
void libvlc_retain( libvlc_instance_t *p_instance )
{
assert( p_instance != NULL );
diff --git a/src/control/libvlc_internal.h b/src/control/libvlc_internal.h
index 076c614..b522ef7 100644
--- a/src/control/libvlc_internal.h
+++ b/src/control/libvlc_internal.h
@@ -44,7 +44,7 @@
* Internal creation and destruction functions
***************************************************************************/
VLC_API libvlc_int_t *libvlc_InternalCreate( void );
-VLC_API int libvlc_InternalInit( libvlc_int_t *, int, const char *ppsz_argv[] );
+VLC_API int libvlc_InternalInit( libvlc_int_t *, int, const char *ppsz_argv[], const void **builtins_module );
VLC_API void libvlc_InternalCleanup( libvlc_int_t * );
VLC_API void libvlc_InternalDestroy( libvlc_int_t * );
diff --git a/src/libvlc.c b/src/libvlc.c
index 4a90f9a..b3fceb3 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -249,7 +249,7 @@ error:
* - configuration and commandline parsing
*/
int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
- const char *ppsz_argv[] )
+ const char *ppsz_argv[], const void **builtins_module )
{
libvlc_priv_t *priv = libvlc_priv (p_libvlc);
char * p_tmp = NULL;
@@ -410,7 +410,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
* list of configuration options exported by each module and loads their
* default values.
*/
- module_LoadPlugins( p_libvlc );
+ module_LoadPlugins( p_libvlc, builtins_module );
if( p_libvlc->b_die )
{
b_exit = true;
diff --git a/src/libvlc.sym b/src/libvlc.sym
index 8e3d835..453f0de 100644
--- a/src/libvlc.sym
+++ b/src/libvlc.sym
@@ -164,6 +164,7 @@ libvlc_media_set_state
libvlc_media_set_user_data
libvlc_media_subitems
libvlc_new
+libvlc_new_with_builtins
libvlc_playlist_play
libvlc_release
libvlc_retain
diff --git a/src/modules/modules.c b/src/modules/modules.c
index fed683c..0247ee6 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -186,13 +186,19 @@ void module_EndBank( vlc_object_t *p_this, bool b_plugins )
* \param p_this vlc object structure
* \return nothing