X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_factory.c;h=d81c0c231d864651cc3a550332dbe7325b5a4a83;hb=f0f9e433051b21e14471bb48bc5d140e6c2b14c5;hp=cd19b158df71a1af3e8a2ad83744fe032ab94953;hpb=d33f444d4ef4c7bc4074d07a49eca0ab7d108394;p=melted diff --git a/src/framework/mlt_factory.c b/src/framework/mlt_factory.c index cd19b15..d81c0c2 100644 --- a/src/framework/mlt_factory.c +++ b/src/framework/mlt_factory.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" #include "mlt.h" #include "mlt_repository.h" @@ -26,6 +25,9 @@ #include #include +#define PREFIX_LIB LIBDIR "/mlt" +#define PREFIX_DATA PREFIX "/share/mlt" + /** Singleton repositories */ @@ -68,7 +70,7 @@ int mlt_factory_init( const char *prefix ) // If no directory is specified, default to install directory if ( prefix == NULL ) - prefix = PREFIX_DATA; + prefix = PREFIX_LIB; // Store the prefix for later retrieval mlt_prefix = strdup( prefix ); @@ -112,6 +114,7 @@ int mlt_factory_init( const char *prefix ) mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" ); mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) ); mlt_properties_set_or_default( global_properties, "MLT_PROFILE", getenv( "MLT_PROFILE" ), "dv_pal" ); + mlt_properties_set_or_default( global_properties, "MLT_DATA", getenv( "MLT_DATA" ), PREFIX_DATA ); } @@ -139,7 +142,10 @@ const char *mlt_factory_prefix( ) char *mlt_environment( const char *name ) { - return mlt_properties_get( global_properties, name ); + if ( global_properties ) + return mlt_properties_get( global_properties, name ); + else + return NULL; } /** Set a value in the environment. @@ -147,7 +153,10 @@ char *mlt_environment( const char *name ) int mlt_environment_set( const char *name, const char *value ) { - return mlt_properties_set( global_properties, name, value ); + if ( global_properties ) + return mlt_properties_set( global_properties, name, value ); + else + return -1; } static void set_common_properties( mlt_properties properties, mlt_profile profile, const char *type, const char *service )