#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.
*
{
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
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;
}