* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "config.h"
#include "mlt.h"
#include "mlt_repository.h"
#include <stdlib.h>
#include <string.h>
+#define PREFIX_LIB LIBDIR "/mlt"
+#define PREFIX_DATA PREFIX "/share/mlt"
+
/** Singleton repositories
*/
// 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 );
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 );
}
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.
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 )