* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
+ * Damien Fouilleul <damienf.fouilleul@laposte.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
{
/* prepare VLC command line */
- char *ppsz_argv[32] =
- {
- "vlc",
- "-vv",
- "--no-stats",
- "--intf", "dummy",
- };
- int ppsz_argc = 5;
+ char *ppsz_argv[32] = { "vlc" };
+ int ppsz_argc = 1;
/* locate VLC module path */
#ifdef XP_MACOSX
{
if( i_type == REG_SZ )
{
- strcat( p_data, "\\vlc" );
- ppsz_argv[0] = p_data;
+ strcat( p_data, "\\plugins" );
+ ppsz_argv[ppsz_argc++] = "--plugin-path";
+ ppsz_argv[ppsz_argc++] = p_data;
}
}
RegCloseKey( h_key );
}
ppsz_argv[ppsz_argc++] = "--no-one-instance";
+ if( IsDebuggerPresent() )
+ {
+ /*
+ ** VLC default threading mechanism is designed to be as compatible
+ ** with POSIX as possible. However when debugged on win32, threads
+ ** lose signals and eventually VLC get stuck during initialization.
+ ** threading support can be configured to be more debugging friendly
+ ** but it will be less compatible with POSIX.
+ ** This is done by initializing with the following options:
+ */
+ ppsz_argv[ppsz_argc++] = "--fast-mutex";
+ ppsz_argv[ppsz_argc++] = "--win9x-cv-method=1";
+ }
+
+
+#if 0
+ ppsz_argv[0] = "C:\\Cygwin\\home\\damienf\\vlc-trunk\\vlc";
+#endif
#endif /* XP_MACOSX */
+ /* common settings */
+ ppsz_argv[ppsz_argc++] = "-vv";
+ ppsz_argv[ppsz_argc++] = "--no-stats";
+ ppsz_argv[ppsz_argc++] = "--no-media-library";
+ ppsz_argv[ppsz_argc++] = "--intf";
+ ppsz_argv[ppsz_argc++] = "dummy";
+
const char *version = NULL;
/* parse plugin arguments */
}
}
else if( !strcmp( argn[i], "version") )
- {
- version = argv[i];
- }
+ {
+ version = argv[i];
+ }
}
libvlc_instance = libvlc_new(ppsz_argc, ppsz_argv, NULL);
/* assign plugin script root class */
if( (NULL != version) && (!strcmp(version, "VideoLAN.VLCPlugin.2")) )
{
- /* new APIs */
- scriptClass = new RuntimeNPClass<LibvlcRootNPObject>();
+ /* new APIs */
+ scriptClass = RuntimeNPClass<LibvlcRootNPObject>::getClass();
}
else
{
- /* legacy APIs */
- scriptClass = new RuntimeNPClass<VlcNPObject>();
+ /* legacy APIs */
+ scriptClass = RuntimeNPClass<VlcNPObject>::getClass();
}
return NPERR_NO_ERROR;
delete psz_baseURL;
delete psz_target;
if( libvlc_instance )
- libvlc_destroy(libvlc_instance);
+ libvlc_destroy(libvlc_instance, NULL );
}
/*****************************************************************************