X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_factory.c;h=dee338e3bab2d36d0716568c8db2791c48454de4;hb=2a800ec4c840132c7a629b764b673dce09771637;hp=0b4df21481c375f3b9a0bc640f339efaf3745362;hpb=2af8bb9f6a61f6510aab8f45abf5f26e9e619c78;p=melted diff --git a/src/framework/mlt_factory.c b/src/framework/mlt_factory.c index 0b4df21..dee338e 100644 --- a/src/framework/mlt_factory.c +++ b/src/framework/mlt_factory.c @@ -46,6 +46,10 @@ int mlt_factory_init( char *prefix ) // Only initialise once if ( mlt_prefix == NULL ) { + // Allow user over rides + if ( prefix == NULL ) + prefix = getenv( "MLT_REPOSITORY" ); + // If no directory is specified, default to install directory if ( prefix == NULL ) prefix = PREFIX_DATA; @@ -58,7 +62,9 @@ int mlt_factory_init( char *prefix ) // Create the global properties global_properties = mlt_properties_new( ); - mlt_properties_set( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ) ); + mlt_properties_set_or_default( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ), "PAL" ); + mlt_properties_set_or_default( global_properties, "MLT_PRODUCER", getenv( "MLT_PRODUCER" ), "fezzik" ); + mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" ); // Create the object list. object_list = mlt_properties_new( ); @@ -94,7 +100,15 @@ char *mlt_environment( char *name ) mlt_producer mlt_factory_producer( char *service, void *input ) { - mlt_producer obj = mlt_repository_fetch( producers, service, input ); + mlt_producer obj = NULL; + + // Pick up the default normalising producer if necessary + if ( service == NULL ) + service = mlt_environment( "MLT_PRODUCER" ); + + // Try to instantiate via the specified service + obj = mlt_repository_fetch( producers, service, input ); + if ( obj != NULL ) { mlt_properties properties = mlt_producer_properties( obj ); @@ -143,7 +157,13 @@ mlt_transition mlt_factory_transition( char *service, void *input ) mlt_consumer mlt_factory_consumer( char *service, void *input ) { - mlt_consumer obj = mlt_repository_fetch( consumers, service, input ); + mlt_consumer obj = NULL; + + if ( service == NULL ) + service = mlt_environment( "MLT_CONSUMER" ); + + obj = mlt_repository_fetch( consumers, service, input ); + if ( obj != NULL ) { mlt_properties properties = mlt_consumer_properties( obj );