mlt_consumer consumer_avformat_init( char *arg )
{
// Allocate the consumer
- mlt_consumer this = calloc( 1, sizeof( struct mlt_consumer_s ) );
+ mlt_consumer this = mlt_consumer_new( );
// If memory allocated and initialises without error
- if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 )
+ if ( this != NULL )
{
// Get properties from the consumer
mlt_properties properties = mlt_consumer_properties( this );
this->stop = consumer_stop;
this->is_stopped = consumer_is_stopped;
}
- else
- {
- // Clean up in case of init failure
- free( this );
- this = NULL;
- }
// Return this
return this;