]> git.sesse.net Git - mlt/commitdiff
On Windows locate plugins and data by directory relative to current directory.
authorDan Dennedy <dan@dennedy.org>
Mon, 17 Jan 2011 08:37:59 +0000 (00:37 -0800)
committerDan Dennedy <dan@dennedy.org>
Mon, 24 Jan 2011 01:39:43 +0000 (17:39 -0800)
lib\mlt
lib\frei0r-1
lib\ladspa
share\mlt
share\ffmpeg

src/framework/mlt_factory.c
src/modules/avformat/configure
src/modules/frei0r/factory.c
src/modules/jackrack/plugin_mgr.c

index 5fe820abdc5658284c0c5d06db21de70d0b4d875..ebfc1076bf7de9b9ccdf6968c2f329c62733b9a4 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef WIN32
+#include <windows.h>
+/** the default subdirectory of the libdir for holding modules (plugins) */
+#define PREFIX_LIB "lib\\mlt"
+/** the default subdirectory of the install prefix for holding module (plugin) data */
+#define PREFIX_DATA "share\\mlt"
+#else
 /** the default subdirectory of the libdir for holding modules (plugins) */
 #define PREFIX_LIB LIBDIR "/mlt"
 /** the default subdirectory of the install prefix for holding module (plugin) data */
 #define PREFIX_DATA PREFIX "/share/mlt"
-
+#endif
 
 /** holds the full path to the modules directory - initialized and retained for the entire session */
 static char *mlt_directory = NULL;
@@ -106,6 +113,7 @@ mlt_repository mlt_factory_init( const char *directory )
                mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" );
                mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) );
                mlt_properties_set_or_default( global_properties, "MLT_PROFILE", getenv( "MLT_PROFILE" ), "dv_pal" );
+
                mlt_properties_set_or_default( global_properties, "MLT_DATA", getenv( "MLT_DATA" ), PREFIX_DATA );
        }
 
@@ -364,7 +372,8 @@ void mlt_factory_close( )
        {
                mlt_properties_close( event_object );
                mlt_properties_close( global_properties );
-               mlt_repository_close( repository );
+               if ( repository )
+                       mlt_repository_close( repository );
                free( mlt_directory );
                mlt_directory = NULL;
                mlt_pool_close( );
index 29e13ad695ea31b7a31c70f6b45f8c34f72d3766..d6c217ac6e67ceed5a7139985df37a8ac4dbdc3e 100755 (executable)
@@ -169,7 +169,14 @@ else
        elif [ "$shared_ffmpeg" != "" ]
        then
                echo "PREFIX=$shared_ffmpeg" >> config.mak
-               echo "CFLAGS+=-DAVDATADIR=\\\"${shared_ffmpeg}/share/ffmpeg/\\\"" >> config.mak
+               case $targetos in
+                       MINGW32_NT-*)
+                               echo "CFLAGS+=-DAVDATADIR=\\\"share/ffmpeg/\\\"" >> config.mak
+                       ;;
+                       *)
+                               echo "CFLAGS+=-DAVDATADIR=\\\"${shared_ffmpeg}/share/ffmpeg/\\\"" >> config.mak
+                       ;;
+               esac
                echo "CFLAGS+=$(pkg-config --cflags libavformat)" >> config.mak
                echo "LDFLAGS+=$(pkg-config --libs-only-L libavformat)" >> config.mak
                if [ "$devices" = "true" ]
index c713b2e4042d81ee1686a6ecea44e0d202f03027..6cedb18f941c5cefa4e5bd2be95597d13288db48 100644 (file)
 #include <stdlib.h>
 #include <limits.h>
 
-#define FREI0R_PLUGIN_PATH "/usr/lib/frei0r-1:/usr/lib64/frei0r-1:/opt/local/lib/frei0r-1:/usr/local/lib/frei0r-1:$HOME/.frei0r-1/lib"
-#define GET_FREI0R_PATH (getenv("FREI0R_PATH") ? getenv("FREI0R_PATH") : getenv("MLT_FREI0R_PLUGIN_PATH") ? getenv("MLT_FREI0R_PLUGIN_PATH") : FREI0R_PLUGIN_PATH)
 
 #ifdef WIN32
 #define LIBSUF ".dll"
+#define FREI0R_PLUGIN_PATH "lib\\frei0r-1"
 #else
 #define LIBSUF ".so"
+#define FREI0R_PLUGIN_PATH "/usr/lib/frei0r-1:/usr/lib64/frei0r-1:/opt/local/lib/frei0r-1:/usr/local/lib/frei0r-1:$HOME/.frei0r-1/lib"
 #endif
 
+#define GET_FREI0R_PATH (getenv("FREI0R_PATH") ? getenv("FREI0R_PATH") : getenv("MLT_FREI0R_PLUGIN_PATH") ? getenv("MLT_FREI0R_PLUGIN_PATH") : FREI0R_PLUGIN_PATH)
+
 extern mlt_filter filter_frei0r_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_frame filter_process( mlt_filter this, mlt_frame frame );
 extern void filter_close( mlt_filter this );
index ca8060922eeded70568d8e0137428b11cf7f845a..4b4bccf7bb2f16efbe76b0c1039d63355e8dcae5 100644 (file)
@@ -211,7 +211,11 @@ plugin_mgr_get_path_plugins (plugin_mgr_t * plugin_mgr)
   
   ladspa_path = g_strdup (getenv ("LADSPA_PATH"));
   if (!ladspa_path)
+#ifdef WIN32
+    ladspa_path = g_strdup ("lib\\ladspa");
+#else
     ladspa_path = g_strdup ("/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/lib64/ladspa");
+#endif
   
   dir = strtok (ladspa_path, ":");
   do