X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_consumer.c;h=5249d9fcf4f08cdc46fdb5ca65ea49ddb589ac1c;hb=72245f174372601b158fda2dc4a2e3f936ea0381;hp=a04863de8da909f66741fbdb88e889e45b4ad5f7;hpb=a01e64529a0e9d097bce26715a45fd4bb3de3538;p=melted diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index a04863d..5249d9f 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -53,6 +53,7 @@ int mlt_consumer_init( mlt_consumer this, void *child ) mlt_properties_set_int( properties, "width", 720 ); mlt_properties_set_int( properties, "height", 576 ); mlt_properties_set_int( properties, "progressive", 0 ); + mlt_properties_set_double( properties, "aspect_ratio", 128.0 / 117.0 ); } else { @@ -61,11 +62,9 @@ int mlt_consumer_init( mlt_consumer this, void *child ) mlt_properties_set_int( properties, "width", 720 ); mlt_properties_set_int( properties, "height", 480 ); mlt_properties_set_int( properties, "progressive", 0 ); + mlt_properties_set_double( properties, "aspect_ratio", 72.0 / 79.0 ); } - // Default aspect ratio - mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); - // Default rescaler for all consumers mlt_properties_set( properties, "rescale", "bilinear" ); @@ -223,6 +222,7 @@ static void *consumer_read_ahead_thread( void *arg ) // Average time for get_frame and get_image int count = 1; + int skipped = 0; int64_t time_wait = 0; int64_t time_frame = 0; int64_t time_image = 0; @@ -263,6 +263,24 @@ static void *consumer_read_ahead_thread( void *arg ) mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 ); mlt_properties_set_int( mlt_frame_properties( frame ), "rendered", 1 ); time_image += time_difference( &ante ); + + // Reset the skipped count + skipped = 0; + } + else + { + // Increment the number of sequentially skipped frames + skipped ++; + + // If we've reached an unacceptable level, reset everything + if ( skipped > 10 ) + { + skipped = 0; + time_frame = 0; + time_image = 0; + time_wait = 0; + count = 0; + } } } @@ -399,4 +417,3 @@ void mlt_consumer_close( mlt_consumer this ) else mlt_service_close( &this->parent ); } -