diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-03-12 19:51:29 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-03-12 19:51:29 +0000 |
commit | 74b8f70949bc265b12f5716fd162e3be9a141d88 (patch) | |
tree | ae2f05fa010513bcfa3e25b01c08c214821997ca /src/xine-engine/metronom.c | |
parent | 995d0f7e8a08bb813c24a49d5bae681d5585fb8c (diff) | |
download | xine-lib-74b8f70949bc265b12f5716fd162e3be9a141d88.tar.gz xine-lib-74b8f70949bc265b12f5716fd162e3be9a141d88.tar.bz2 |
getting rid of more LOG_ macros => output messages only once ... and another metronom drift update - will I ever get this one correct?
CVS patchset: 1564
CVS date: 2002/03/12 19:51:29
Diffstat (limited to 'src/xine-engine/metronom.c')
-rw-r--r-- | src/xine-engine/metronom.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index adfba2f77..30f8c9f65 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.67 2002/03/12 11:04:07 guenter Exp $ + * $Id: metronom.c,v 1.68 2002/03/12 19:51:29 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -368,6 +368,9 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { } else { this->video_drift = diff; + this->video_drift_step = diff / 30; + /* this will fix video drift with a constant compensation each + frame for about 1 second of video. */ #ifdef LOG if (diff) @@ -384,11 +387,9 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { (this->video_drift<0)?'+':'-', abs(this->video_drift) ); #endif - /* this will fix video drift with a constant compensation each - frame for about 1 second of video. */ - img->duration -= this->video_drift/30; - if (this->video_drift) - this->video_drift -= this->video_drift / 30; + img->duration -= this->video_drift_step; + + this->video_drift -= this->video_drift_step; if (this->video_drift<0) this->video_drift = 0; @@ -620,6 +621,7 @@ metronom_t * metronom_init (int have_audio, void *xine) { this->video_vpts = PREBUFFER_PTS_OFFSET; this->video_drift = 0; + this->video_drift_step = 0; this->video_discontinuity_count = 0; pthread_cond_init (&this->video_discontinuity_reached, NULL); |