]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_multitrack.c
Let Movit effects supply their own fingerprint.
[mlt] / src / framework / mlt_multitrack.c
index 389d72ece68bf7205556187c8eb992ef52d1b656..463090729b2fb845ed78e4e31e55631118c76b86 100644 (file)
@@ -43,7 +43,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 mlt_multitrack mlt_multitrack_init( )
 {
        // Allocate the multitrack object
-       mlt_multitrack self = calloc( sizeof( struct mlt_multitrack_s ), 1 );
+       mlt_multitrack self = calloc( 1, sizeof( struct mlt_multitrack_s ) );
 
        if ( self != NULL )
        {
@@ -212,8 +212,14 @@ int mlt_multitrack_connect( mlt_multitrack self, mlt_producer producer, int trac
 
                // Increment the track count if need be
                if ( track >= self->count )
+               {
                        self->count = track + 1;
 
+                       // TODO: Move this into producer_avformat.c when mlt_events broadcasting is available.
+                       if ( self->count > mlt_service_cache_get_size( MLT_MULTITRACK_SERVICE( self ), "producer_avformat" ) )
+                               mlt_service_cache_set_size( MLT_MULTITRACK_SERVICE( self ), "producer_avformat", self->count + 1 );
+               }
+
                // Refresh our stats
                mlt_multitrack_refresh( self );
        }
@@ -317,7 +323,7 @@ mlt_position mlt_multitrack_clip( mlt_multitrack self, mlt_whence whence, int in
        mlt_position position = 0;
        int i = 0;
        int j = 0;
-       mlt_position *map = malloc( 1000 * sizeof( mlt_position ) );
+       mlt_position *map = calloc( 1000, sizeof( mlt_position ) );
        int count = 0;
 
        for ( i = 0; i < self->count; i ++ )