]> git.sesse.net Git - vlc/commitdiff
* Now the MacOS mozilla plugin is an independant bundle ( searchs no more
authorSimon Latapie <garf@videolan.org>
Wed, 27 Aug 2003 07:21:07 +0000 (07:21 +0000)
committerSimon Latapie <garf@videolan.org>
Wed, 27 Aug 2003 07:21:07 +0000 (07:21 +0000)
 * in /usr/local/lib/vlc for modules )

mozilla/Makefile.am
mozilla/vlcshell.cpp

index 678c932b80b2fb56d5b6606eba95d41fe8d16902..45d8625b30dcc47a7e15dbdd58ed00868b24203f 100644 (file)
@@ -96,6 +96,8 @@ VLC\ Plugin.plugin:
        cp $(top_srcdir)/extras/MacOSX/plugin/pbdevelopment.plist $(srcdir)/VLC\ Plugin.plugin/Contents/pbdevelopment.plist
        cp -r $(top_srcdir)/extras/MacOSX/plugin/English.lproj $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/
        Rez /Developer/Headers/FlatCarbon/Types.r $(srcdir)/vlc.r -o $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/Vlc\ Plugin.rsrc
+       mkdir $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/modules
+       cp -r $(top_srcdir)/VLC.app/Contents/MacOS/modules/* $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/modules/
 endif
 endif
 
index 87d06d1cc5d09e95c368dfc7e3b2d1bfcefcee9c..1c2ed3747ec53bf2b3f82e3da2e8935d89648aea 100644 (file)
@@ -2,7 +2,7 @@
  * vlcshell.cpp: a VLC plugin for Mozilla
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: vlcshell.cpp,v 1.19 2003/08/25 14:51:49 garf Exp $
+ * $Id: vlcshell.cpp,v 1.20 2003/08/27 07:21:07 garf Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -242,12 +242,31 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
 #if USE_LIBVLC
     vlc_value_t value;
     int i_ret;
+    char * home_user;
+    char * plugin_path;
+    char * directory;
+
+#ifdef XP_MACOSX
+    home_user = strdup( getenv("HOME") );
+    directory = strdup( "/Library/Internet Plug-Ins/VLC Plugin.plugin/Contents/MacOS/modules" );
+    plugin_path = malloc( strlen( directory ) + strlen( home_user ) );
+    memcpy( plugin_path , home_user , strlen(home_user) );
+    memcpy( plugin_path + strlen( home_user ) , directory , strlen( directory ) );
 
+    char *ppsz_foo[] =
+    {
+        "vlc"
+        /* , "--plugin-path", "/Library/Internet Plug-Ins/VLC Plugin.plugin/Contents/MacOS/modules" */
+        , "--plugin-path", plugin_path
+        , "--filter invert"
+    };
+#else
     char *ppsz_foo[] =
     {
         "vlc"
         /*, "--plugin-path", "/home/sam/videolan/vlc_MAIN/plugins"*/
     };
+#endif
 #endif
 
     if( instance == NULL )
@@ -299,6 +318,12 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
         return NPERR_GENERIC_ERROR;
     }
 
+#ifdef XP_MACOSX
+    free(home_user);
+    free(directory);
+    free(plugin_path);
+#endif
+
     value.psz_string = "dummy";
     VLC_Set( p_plugin->i_vlc, "conf::intf", value );
     value.psz_string = VOUT_PLUGINS;
@@ -472,6 +497,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     text = strdup( WINDOW_TEXT );
     MoveTo( valuew.i_int / 2 - 40 , valueh.i_int / 2 );
     DrawText( text , 0 , strlen(text) );
+    free(text);
 
 #else
     /* FIXME: this cast sucks */