From 424421c360c5108a38c8a88957c78afbc9308284 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 12 Mar 2002 22:00:07 +0000 Subject: another try to fix drift CVS patchset: 1565 CVS date: 2002/03/12 22:00:07 --- src/xine-engine/metronom.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 30f8c9f65..bed16b901 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: metronom.c,v 1.68 2002/03/12 19:51:29 guenter Exp $ + * $Id: metronom.c,v 1.69 2002/03/12 22:00:07 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -382,17 +382,17 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { img->vpts = this->video_vpts + this->av_offset; #ifdef LOG - printf ("metronom: video vpts for %10lld : %10lld (duration:%d%c%d)\n", - pts, this->video_vpts, img->duration, - (this->video_drift<0)?'+':'-', abs(this->video_drift) ); + printf ("metronom: video vpts for %10lld : %10lld (duration:%d drift:%lld step:%lld)\n", + pts, this->video_vpts, img->duration, this->video_drift, this->video_drift_step ); #endif - img->duration -= this->video_drift_step; - - this->video_drift -= this->video_drift_step; - if (this->video_drift<0) - this->video_drift = 0; + if( this->video_drift * this->video_drift_step > 0 ) + { + img->duration -= this->video_drift_step; + this->video_drift -= this->video_drift_step; + } + this->video_vpts += img->duration; pthread_mutex_unlock (&this->lock); -- cgit v1.2.3