mirror of
https://github.com/videolan/vlc.git
synced 2024-12-03 23:04:35 +08:00
vlc: assume UTF-8 and drop dependency on libvlccore
This commit is contained in:
parent
bc032f3ca6
commit
ae7b55a4f9
@ -33,7 +33,7 @@ vlc_wrapper_SOURCES = rootwrap.c
|
||||
vlc_wrapper_LDADD = $(SOCKET_LIBS)
|
||||
|
||||
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_CFLAGS = $(AM_CFLAGS) \
|
||||
@ -63,7 +63,7 @@ vlc_cache_gen_SOURCES = cachegen.c
|
||||
vlc_cache_gen_LDADD = \
|
||||
$(GNUGETOPT_LIBS) \
|
||||
../compat/libcompat.la \
|
||||
../lib/libvlc.la ../src/libvlccore.la
|
||||
../lib/libvlc.la
|
||||
if HAVE_WIN32
|
||||
vlc_cache_gen_LDADD += vlc_win32_rc.$(OBJEXT)
|
||||
vlc_cache_gen_DEPENDENCIES = vlc_win32_rc.$(OBJEXT)
|
||||
|
@ -45,10 +45,6 @@ static void usage (const char *path)
|
||||
path);
|
||||
}
|
||||
|
||||
/* Explicit HACK */
|
||||
extern void LocaleFree (const char *);
|
||||
extern char *FromLocale (const char *);
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
static const struct option opts[] =
|
||||
@ -81,8 +77,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
for (int i = optind; i < argc; i++)
|
||||
{
|
||||
/* Note that FromLocale() can be used before libvlc is initialized */
|
||||
const char *path = FromLocale (argv[i]);
|
||||
const char *path = argv[i];
|
||||
|
||||
if (setenv ("VLC_PLUGIN_PATH", path, 1))
|
||||
abort ();
|
||||
@ -101,7 +96,6 @@ int main (int argc, char *argv[])
|
||||
libvlc_release (vlc);
|
||||
if (vlc == NULL)
|
||||
fprintf (stderr, "No plugins in %s\n", path);
|
||||
LocaleFree (path);
|
||||
if (vlc == NULL)
|
||||
return 1;
|
||||
}
|
||||
|
21
bin/vlc.c
21
bin/vlc.c
@ -50,9 +50,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Explicit HACK */
|
||||
extern void LocaleFree (const char *);
|
||||
extern char *FromLocale (const char *);
|
||||
extern void vlc_enable_override (void);
|
||||
|
||||
static bool signal_ignored (int signum)
|
||||
@ -173,28 +170,14 @@ int main( int i_argc, const char *ppsz_argv[] )
|
||||
/* Block all these signals */
|
||||
pthread_sigmask (SIG_SETMASK, &set, NULL);
|
||||
|
||||
/* Note that FromLocale() can be used before libvlc is initialized */
|
||||
const char *argv[i_argc + 3];
|
||||
int argc = 0;
|
||||
|
||||
argv[argc++] = "--no-ignore-config";
|
||||
argv[argc++] = "--media-library";
|
||||
#ifdef TOP_SRCDIR
|
||||
argv[argc++] = FromLocale ("--data-path="TOP_SRCDIR"/share");
|
||||
argv[argc++] = "--data-path="TOP_SRCDIR"/share";
|
||||
#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;
|
||||
|
||||
vlc_enable_override ();
|
||||
@ -249,8 +232,6 @@ int main( int i_argc, const char *ppsz_argv[] )
|
||||
out:
|
||||
if (vlc != NULL)
|
||||
libvlc_release (vlc);
|
||||
for (int i = 2; i < argc; i++)
|
||||
LocaleFree (argv[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user