X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_repository.c;h=3ab95bed696fe384b960f6fa31b0d34f093e22aa;hb=6967e58ddd118f3fd0e071cfaeff89c56fd612c5;hp=7f474f33a8ff4c87e7f16b0f65545126757b1766;hpb=16b6d374cf80004b192aae74a55b0452c7ee809d;p=melted diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index 7f474f3..3ab95be 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -35,8 +35,12 @@ struct mlt_repository_s mlt_properties transitions; }; -mlt_repository mlt_repository_init( const char *prefix ) +mlt_repository mlt_repository_init( const char *directory ) { + // Safety check + if ( directory == NULL || strcmp( directory, "" ) == 0 ) + return NULL; + // Construct the repository mlt_repository this = calloc( sizeof( struct mlt_repository_s ), 1 ); mlt_properties_init( &this->parent, this ); @@ -44,10 +48,10 @@ mlt_repository mlt_repository_init( const char *prefix ) this->filters = mlt_properties_new(); this->producers = mlt_properties_new(); this->transitions = mlt_properties_new(); - + // Get the directory list mlt_properties dir = mlt_properties_new(); - int count = mlt_properties_dir_list( dir, prefix, NULL, 0 ); + int count = mlt_properties_dir_list( dir, directory, NULL, 0 ); int i; // Iterate over files @@ -108,7 +112,7 @@ void mlt_repository_register( mlt_repository this, mlt_service_type service_type } } -void *mlt_repository_fetch( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input ) +void *mlt_repository_create( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input ) { void *( *symbol_ptr )( mlt_profile, mlt_service_type, const char *, void * ) = NULL;