X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fffmpeg%2Ffilter_ffmpeg_dub.c;h=c46dcd859951cde2caecb242076cb75506751725;hb=10e377d51ca937d99a68723dd53026953a6a5c6d;hp=0d678af208ea9720e96eca0499af70f085002eb5;hpb=7c518e80321a87a22d2e48835442c9f5b70dcd17;p=melted diff --git a/src/modules/ffmpeg/filter_ffmpeg_dub.c b/src/modules/ffmpeg/filter_ffmpeg_dub.c index 0d678af..c46dcd8 100644 --- a/src/modules/ffmpeg/filter_ffmpeg_dub.c +++ b/src/modules/ffmpeg/filter_ffmpeg_dub.c @@ -117,25 +117,27 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) mlt_filter filter_ffmpeg_dub_init( char *file ) { // Create the filter object - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter this = mlt_filter_new( ); // Initialise it - mlt_filter_init( this, NULL ); - - // Overide the filter process method - this->process = filter_process; + if ( this != NULL ) + { + // Obtain the properties + mlt_properties properties = mlt_filter_properties( this ); - // Obtain the properties - mlt_properties properties = mlt_filter_properties( this ); + // Create an ffmpeg producer + // TODO: THIS SHOULD NOT BE HERE.... + mlt_producer producer = mlt_factory_producer( "ffmpeg", file ); - // Create an ffmpeg producer - mlt_producer producer = mlt_factory_producer( "ffmpeg", file ); + // Overide the filter process method + this->process = filter_process; - // Pass the producer - mlt_properties_set_data( properties, "producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL ); + // Pass the producer + mlt_properties_set_data( properties, "producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL ); - // Initialise the audio frame position - mlt_properties_set_position( properties, "dub_position", 0 ); + // Initialise the audio frame position + mlt_properties_set_position( properties, "dub_position", 0 ); + } return this; }