]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_repository.c
Add mlt_audio_u8 (sourceforce-182).
[mlt] / src / framework / mlt_repository.c
index 5858e4486f46c45832a928ac6b2702114c1267ff..e5e5e79388458f3d31fd46f22edafb8d9fcf51a6 100644 (file)
@@ -36,6 +36,9 @@
 #include <dirent.h>
 #include <sys/stat.h>
 
+/** the default subdirectory of the datadir for holding presets */
+#define PRESETS_DIR "/presets"
+
 /** \brief Repository class
  *
  * The Repository is a collection of plugin modules and their services and service metadata.
@@ -67,7 +70,7 @@ mlt_repository mlt_repository_init( const char *directory )
                return NULL;
 
        // Construct the repository
-       mlt_repository self = calloc( sizeof( struct mlt_repository_s ), 1 );
+       mlt_repository self = calloc( 1, sizeof( struct mlt_repository_s ));
        mlt_properties_init( &self->parent, self );
        self->consumers = mlt_properties_new();
        self->filters = mlt_properties_new();
@@ -492,9 +495,9 @@ mlt_properties mlt_repository_presets( )
        }
        else
        {
-               path = malloc( strlen( mlt_environment( "MLT_DATA" ) ) + 9 );
+               path = malloc( strlen( mlt_environment( "MLT_DATA" ) ) + strlen( PRESETS_DIR ) + 1 );
                strcpy( path, mlt_environment( "MLT_DATA" ) );
-               strcat( path, "/presets" );
+               strcat( path, PRESETS_DIR );
        }
        list_presets( result, NULL, path );
        free( path );