From f535fbdf050061d9cd7be17529d878f7e2d12cb3 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sat, 9 Apr 2011 14:13:10 -0700 Subject: [PATCH] Fix mlt_profile_list when MLT_PROFILES_PATH not set. --- src/framework/mlt_profile.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/framework/mlt_profile.c b/src/framework/mlt_profile.c index e2ccc56c..d1c0237b 100644 --- a/src/framework/mlt_profile.c +++ b/src/framework/mlt_profile.c @@ -347,6 +347,7 @@ mlt_profile mlt_profile_clone( mlt_profile profile ) mlt_properties mlt_profile_list( ) { + char *filename = NULL; const char *prefix = getenv( "MLT_PROFILES_PATH" ); mlt_properties properties = mlt_properties_new(); mlt_properties dir = mlt_properties_new(); @@ -356,7 +357,15 @@ mlt_properties mlt_profile_list( ) // Load from $prefix/share/mlt/profiles if no env var if ( prefix == NULL ) + { prefix = PREFIX; + filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + 2 ); + strcpy( filename, prefix ); + if ( filename[ strlen( filename ) - 1 ] != '/' ) + filename[ strlen( filename ) ] = '/'; + strcat( filename, PROFILES_DIR ); + prefix = filename; + } mlt_properties_dir_list( dir, prefix, wildcard, sort ); @@ -376,6 +385,8 @@ mlt_properties mlt_profile_list( ) } } mlt_properties_close( dir ); + if ( filename ) + free( filename ); return properties; } -- 2.39.2