]> git.sesse.net Git - mlt/commitdiff
Make profiles relative to MLT_DATA instead of $prefix/share/mlt
authorDan Dennedy <dan@dennedy.org>
Fri, 23 Sep 2011 07:34:10 +0000 (00:34 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 25 Sep 2011 20:59:21 +0000 (13:59 -0700)
src/framework/mlt_profile.c
src/framework/mlt_repository.c

index 542a8f11b896984aabe4dbda80d6abed78ed7cec..b8816eeab9311591588177d0547db9bf55fb43ba 100644 (file)
@@ -28,8 +28,8 @@
 #include <libgen.h>
 
 
-/** the default subdirectory of the prefix for holding profiles */
-#define PROFILES_DIR "/share/mlt/profiles/"
+/** the default subdirectory of the datadir for holding profiles */
+#define PROFILES_DIR "/profiles"
 
 /** Load a profile from the system folder.
  *
@@ -356,7 +356,7 @@ mlt_properties mlt_profile_list( )
        // Load from $prefix/share/mlt/profiles if no env var
        if ( prefix == NULL )
        {
-               prefix = PREFIX;
+               prefix = mlt_environment( "MLT_DATA" );
                filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + 2 );
                strcpy( filename, prefix );
                if ( filename[ strlen( filename ) - 1 ] != '/' )
index 5858e4486f46c45832a928ac6b2702114c1267ff..ffb65daff57db3832420641f8aae61afd42ee50d 100644 (file)
@@ -36,6 +36,9 @@
 #include <dirent.h>
 #include <sys/stat.h>
 
+/** the default subdirectory of the datadir for holding presets */
+#define PRESETS_DIR "/presets"
+
 /** \brief Repository class
  *
  * The Repository is a collection of plugin modules and their services and service metadata.
@@ -494,7 +497,9 @@ mlt_properties mlt_repository_presets( )
        {
                path = malloc( strlen( mlt_environment( "MLT_DATA" ) ) + 9 );
                strcpy( path, mlt_environment( "MLT_DATA" ) );
-               strcat( path, "/presets" );
+               if ( path[ strlen( path ) - 1 ] != '/' )
+                       path[ strlen( path ) ] = '/';
+               strcat( path, PRESETS_DIR );
        }
        list_presets( result, NULL, path );
        free( path );