From 6b3d9bae5b3c26479e15b6146b6151048982b343 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Fri, 23 Sep 2011 00:34:10 -0700 Subject: [PATCH] Make profiles relative to MLT_DATA instead of $prefix/share/mlt --- src/framework/mlt_profile.c | 6 +++--- src/framework/mlt_repository.c | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/framework/mlt_profile.c b/src/framework/mlt_profile.c index 542a8f11..b8816eea 100644 --- a/src/framework/mlt_profile.c +++ b/src/framework/mlt_profile.c @@ -28,8 +28,8 @@ #include -/** 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 ] != '/' ) diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index 5858e448..ffb65daf 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -36,6 +36,9 @@ #include #include +/** 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 ); -- 2.39.2