From: Dan Dennedy Date: Thu, 2 May 2013 06:50:16 +0000 (-0700) Subject: Fix inaccurate seeking in consumer producer. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e69f03f35bdfa9f8557b9fdb626c660d36c8f984;p=mlt Fix inaccurate seeking in consumer producer. This led to crackling audio. --- diff --git a/src/modules/core/producer_consumer.c b/src/modules/core/producer_consumer.c index 794843d0..d777e949 100644 --- a/src/modules/core/producer_consumer.c +++ b/src/modules/core/producer_consumer.c @@ -168,8 +168,8 @@ static int get_frame( mlt_producer this, mlt_frame_ptr frame, int index ) if ( mlt_producer_get_speed( this ) != 0 ) actual_position *= mlt_producer_get_speed( this ); mlt_position need_first = floor( actual_position ); - mlt_producer_seek( cx->producer, need_first * mlt_profile_fps( cx->profile ) - / mlt_producer_get_fps( this ) ); + mlt_producer_seek( cx->producer, + lrint( need_first * mlt_profile_fps( cx->profile ) / mlt_producer_get_fps( this ) ) ); // Get the nested frame mlt_frame nested_frame = mlt_consumer_rt_frame( cx->consumer );