]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_profile.c
Fix regression loading profile.
[mlt] / src / framework / mlt_profile.c
index 542a8f11b896984aabe4dbda80d6abed78ed7cec..66f76012aee88f0d89807078e78114230dc7247b 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.
  *
@@ -53,14 +53,12 @@ static mlt_profile mlt_profile_select( const char *name )
        {
                filename = calloc( 1, strlen( name ) + 1 );
        }
-       // Load from $prefix/share/mlt/profiles
+       // Load from $datadir/mlt/profiles
        else if ( prefix == NULL )
        {
-               prefix = PREFIX;
-               filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + strlen( name ) + 2 );
+               prefix = mlt_environment( "MLT_DATA" );
+               filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + strlen( name ) + 1 );
                strcpy( filename, prefix );
-               if ( filename[ strlen( filename ) - 1 ] != '/' )
-                       filename[ strlen( filename ) ] = '/';
                strcat( filename, PROFILES_DIR );
        }
        // Use environment variable instead
@@ -353,14 +351,12 @@ mlt_properties mlt_profile_list( )
        const char *wildcard = NULL;
        int i;
 
-       // Load from $prefix/share/mlt/profiles if no env var
+       // Load from $datadir/mlt/profiles if no env var
        if ( prefix == NULL )
        {
-               prefix = PREFIX;
-               filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + 2 );
+               prefix = mlt_environment( "MLT_DATA" );
+               filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + 1 );
                strcpy( filename, prefix );
-               if ( filename[ strlen( filename ) - 1 ] != '/' )
-                       filename[ strlen( filename ) ] = '/';
                strcat( filename, PROFILES_DIR );
                prefix = filename;
        }