]> git.sesse.net Git - mlt/commitdiff
Fix inaccurate seeking in consumer producer.
authorDan Dennedy <dan@dennedy.org>
Thu, 2 May 2013 06:50:16 +0000 (23:50 -0700)
committerDan Dennedy <dan@dennedy.org>
Thu, 2 May 2013 06:50:16 +0000 (23:50 -0700)
This led to crackling audio.

src/modules/core/producer_consumer.c

index 794843d0c8cc9e4526262e3d7f239f995098b5eb..d777e949bb756f7c4b70f94683e721c32314ccb4 100644 (file)
@@ -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 );