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 )
{
// 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 );
}
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 ++ )