X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_producer.c;h=164ed59e5895d1b2d39feaf8f35c15c27e709f4d;hb=1a50e779cfd5e1bc6a80054f6f56e64280c2dc41;hp=91e39896a270825bd061983d8c2e3530ec6520ee;hpb=661165812e3410fe2f6f49d7af882b36a0efcf82;p=melted diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index 91e3989..164ed59 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -52,14 +52,16 @@ int mlt_producer_init( mlt_producer this, void *child ) mlt_properties properties = mlt_service_properties( parent ); // 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_timecode( properties, "out", 3600.0 ); + mlt_properties_set_timecode( properties, "length", 3600.0 ); + mlt_properties_set_int( properties, "known_length", 1 ); + mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); // Override service get_frame parent->get_frame = producer_get_frame; @@ -202,7 +204,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 ); @@ -231,7 +232,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. @@ -276,6 +277,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; }