Commit ae7b55a4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vlc: assume UTF-8 and drop dependency on libvlccore

parent bc032f3c
...@@ -33,7 +33,7 @@ vlc_wrapper_SOURCES = rootwrap.c ...@@ -33,7 +33,7 @@ vlc_wrapper_SOURCES = rootwrap.c
vlc_wrapper_LDADD = $(SOCKET_LIBS) vlc_wrapper_LDADD = $(SOCKET_LIBS)
vlc_LDFLAGS = $(LDFLAGS_vlc) vlc_LDFLAGS = $(LDFLAGS_vlc)
vlc_LDADD = ../lib/libvlc.la ../src/libvlccore.la $(LIBS_vlc) vlc_LDADD = ../lib/libvlc.la $(LIBS_vlc)
vlc_static_SOURCES = $(vlc_SOURCES) vlc_static_SOURCES = $(vlc_SOURCES)
vlc_static_CFLAGS = $(AM_CFLAGS) \ vlc_static_CFLAGS = $(AM_CFLAGS) \
...@@ -63,7 +63,7 @@ vlc_cache_gen_SOURCES = cachegen.c ...@@ -63,7 +63,7 @@ vlc_cache_gen_SOURCES = cachegen.c
vlc_cache_gen_LDADD = \ vlc_cache_gen_LDADD = \
$(GNUGETOPT_LIBS) \ $(GNUGETOPT_LIBS) \
../compat/libcompat.la \ ../compat/libcompat.la \
../lib/libvlc.la ../src/libvlccore.la ../lib/libvlc.la
if HAVE_WIN32 if HAVE_WIN32
vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT) vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT) vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
......
...@@ -45,10 +45,6 @@ static void usage (const char *path) ...@@ -45,10 +45,6 @@ static void usage (const char *path)
path); path);
} }
/* Explicit HACK */
extern void LocaleFree (const char *);
extern char *FromLocale (const char *);
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
static const struct option opts[] = static const struct option opts[] =
...@@ -81,8 +77,7 @@ int main (int argc, char *argv[]) ...@@ -81,8 +77,7 @@ int main (int argc, char *argv[])
for (int i = optind; i < argc; i++) for (int i = optind; i < argc; i++)
{ {
/* Note that FromLocale() can be used before libvlc is initialized */ const char *path = argv[i];
const char *path = FromLocale (argv[i]);
if (setenv ("VLC_PLUGIN_PATH", path, 1)) if (setenv ("VLC_PLUGIN_PATH", path, 1))
abort (); abort ();
...@@ -101,7 +96,6 @@ int main (int argc, char *argv[]) ...@@ -101,7 +96,6 @@ int main (int argc, char *argv[])
libvlc_release (vlc); libvlc_release (vlc);
if (vlc == NULL) if (vlc == NULL)
fprintf (stderr, "No plugins in %s\n", path); fprintf (stderr, "No plugins in %s\n", path);
LocaleFree (path);
if (vlc == NULL) if (vlc == NULL)
return 1; return 1;
} }
......
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
#endif #endif
/* Explicit HACK */
extern void LocaleFree (const char *);
extern char *FromLocale (const char *);
extern void vlc_enable_override (void); extern void vlc_enable_override (void);
static bool signal_ignored (int signum) static bool signal_ignored (int signum)
...@@ -173,28 +170,14 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -173,28 +170,14 @@ int main( int i_argc, const char *ppsz_argv[] )
/* Block all these signals */ /* Block all these signals */
pthread_sigmask (SIG_SETMASK, &set, NULL); pthread_sigmask (SIG_SETMASK, &set, NULL);
/* Note that FromLocale() can be used before libvlc is initialized */
const char *argv[i_argc + 3]; const char *argv[i_argc + 3];
int argc = 0; int argc = 0;
argv[argc++] = "--no-ignore-config"; argv[argc++] = "--no-ignore-config";
argv[argc++] = "--media-library"; argv[argc++] = "--media-library";
#ifdef TOP_SRCDIR #ifdef TOP_SRCDIR
argv[argc++] = FromLocale ("--data-path="TOP_SRCDIR"/share"); argv[argc++] = "--data-path="TOP_SRCDIR"/share";
#endif #endif
int i = 1;
#ifdef __APPLE__
/* When VLC.app is run by double clicking in Mac OS X, the 2nd arg
* is the PSN - process serial number (a unique PID-ish thingie)
* still ok for real Darwin & when run from command line
* for example -psn_0_9306113 */
if(i_argc >= 2 && !strncmp( ppsz_argv[1] , "-psn" , 4 ))
i = 2;
#endif
for (; i < i_argc; i++)
if ((argv[argc++] = FromLocale (ppsz_argv[i])) == NULL)
return 1; // BOOM!
argv[argc] = NULL; argv[argc] = NULL;
vlc_enable_override (); vlc_enable_override ();
...@@ -249,8 +232,6 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -249,8 +232,6 @@ int main( int i_argc, const char *ppsz_argv[] )
out: out:
if (vlc != NULL) if (vlc != NULL)
libvlc_release (vlc); libvlc_release (vlc);
for (int i = 2; i < argc; i++)
LocaleFree (argv[i]);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment