summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-03-12 22:00:07 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-03-12 22:00:07 +0000
commit424421c360c5108a38c8a88957c78afbc9308284 (patch)
tree09290a23aac5f94fbb13bf7faf758414fc954efe
parent74b8f70949bc265b12f5716fd162e3be9a141d88 (diff)
downloadxine-lib-424421c360c5108a38c8a88957c78afbc9308284.tar.gz
xine-lib-424421c360c5108a38c8a88957c78afbc9308284.tar.bz2
another try to fix drift
CVS patchset: 1565 CVS date: 2002/03/12 22:00:07
-rw-r--r--src/xine-engine/metronom.c18
1 files 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);