X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_producer.c;h=751e19a9e3066309fd03efd267743c15325a6e97;hb=9390e8b584f3f717f0a326893c0e37cf187a0a51;hp=7dc6c6e8c86feee2aa7064de7e21a798d66adba4;hpb=6bec62ff1136da4f90a82d2d90901b48770a85a3;p=melted diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index 7dc6c6e..751e19a 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -54,15 +54,15 @@ int mlt_producer_init( mlt_producer this, void *child ) // Set the default properties mlt_properties_set( properties, "mlt_type", "mlt_producer" ); mlt_properties_set_timecode( properties, "position", 0.0 ); - mlt_properties_set_double( properties, "frame", 1 ); + mlt_properties_set_double( properties, "frame", 0 ); mlt_properties_set_double( properties, "fps", 25.0 ); mlt_properties_set_double( properties, "speed", 1.0 ); mlt_properties_set_timecode( properties, "in", 0.0 ); mlt_properties_set_timecode( properties, "out", 36000.0 ); - mlt_properties_set_timecode( properties, "playtime", 36000.0 ); mlt_properties_set_timecode( properties, "length", 36000.0 ); mlt_properties_set_int( properties, "known_length", 1 ); mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); + mlt_properties_set( properties, "log_id", "multitrack" ); // Override service get_frame parent->get_frame = producer_get_frame; @@ -205,7 +205,6 @@ int mlt_producer_set_in_and_out( mlt_producer this, mlt_timecode in, mlt_timecod // Set the values mlt_properties_set_timecode( mlt_producer_properties( this ), "in", in ); mlt_properties_set_timecode( mlt_producer_properties( this ), "out", out ); - mlt_properties_set_timecode( mlt_producer_properties( this ), "playtime", out - in ); // Seek to the in point mlt_producer_seek( this, 0 ); @@ -234,7 +233,7 @@ mlt_timecode mlt_producer_get_out( mlt_producer this ) mlt_timecode mlt_producer_get_playtime( mlt_producer this ) { - return mlt_properties_get_timecode( mlt_producer_properties( this ), "playtime" ); + return mlt_producer_get_out( this ) - mlt_producer_get_in( this ); } /** Get the total length of the producer. @@ -266,6 +265,10 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind { // Get the frame from the implementation result = this->get_frame( this, frame, index ); + + mlt_properties frame_properties = mlt_frame_properties( *frame ); + double speed = mlt_producer_get_speed( this ); + mlt_properties_set_double( frame_properties, "speed", speed ); } else { @@ -279,6 +282,10 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind mlt_producer_prepare_next( this ); } + // Copy the fps of the producer onto the frame + mlt_properties properties = mlt_frame_properties( *frame ); + mlt_properties_set_double( properties, "fps", mlt_producer_get_fps( this ) ); + return 0; }