X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_producer.c;h=9254710fb5cd4567b1aaa221ee3bbedfee2b6fee;hb=573abb05e2b070c67daa9f97981e4c707ba96014;hp=3c953d624446774382efa97b77a1dc33549bf3c4;hpb=2d9ad7ff9d46ac8da7fb0d1d350febbe0c24317d;p=melted diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index 3c953d6..9254710 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -51,6 +51,9 @@ int mlt_producer_init( mlt_producer this, void *child ) // Initialise the service if ( mlt_service_init( &this->parent, this ) == 0 ) { + // Get the normalisation preference + char *normalisation = getenv( "MLT_NORMALISATION" ); + // The parent is the service mlt_service parent = &this->parent; @@ -61,11 +64,14 @@ int mlt_producer_init( mlt_producer this, void *child ) mlt_properties_set( properties, "mlt_type", "mlt_producer" ); mlt_properties_set_position( properties, "_position", 0.0 ); mlt_properties_set_double( properties, "_frame", 0 ); - mlt_properties_set_double( properties, "fps", 25.0 ); + if ( normalisation == NULL || strcmp( normalisation, "NTSC" ) ) + mlt_properties_set_double( properties, "fps", 25.0 ); + else + mlt_properties_set_double( properties, "fps", 30000.0 / 1001.0 ); mlt_properties_set_double( properties, "_speed", 1.0 ); mlt_properties_set_position( properties, "in", 0 ); - mlt_properties_set_position( properties, "out", 1799999 ); - mlt_properties_set_position( properties, "length", 1800000 ); + mlt_properties_set_position( properties, "out", 14999 ); + mlt_properties_set_position( properties, "length", 15000 ); mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); mlt_properties_set( properties, "eof", "pause" ); mlt_properties_set( properties, "resource", "" ); @@ -249,8 +255,6 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind char *eof = mlt_properties_get( mlt_producer_properties( this ), "eof" ); // A properly instatiated producer will have a get_frame method... -//fprintf( stderr, "PRODUCER get_frame %p eof %s pos %lld out %lld\n", -//this->get_frame, eof, mlt_producer_position( this ), mlt_producer_get_out( this ) ); if ( this->get_frame == NULL || ( !strcmp( eof, "continue" ) && mlt_producer_position( this ) > mlt_producer_get_out( this ) ) ) { // Generate a test frame @@ -259,6 +263,10 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind // Set the position result = mlt_frame_set_position( *frame, mlt_producer_position( this ) ); + // Mark as a test card + mlt_properties_set_int( mlt_frame_properties( *frame ), "test_image", 1 ); + mlt_properties_set_int( mlt_frame_properties( *frame ), "test_audio", 1 ); + // Calculate the next position mlt_producer_prepare_next( this ); }