diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-03-12 11:04:06 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-03-12 11:04:06 +0000 |
commit | 995d0f7e8a08bb813c24a49d5bae681d5585fb8c (patch) | |
tree | 130886617dd5422ab3548572c335697708d5c265 /src/xine-engine/metronom.c | |
parent | eaed2e8e8143e119ba09966860e0165bedcf6414 (diff) | |
download | xine-lib-995d0f7e8a08bb813c24a49d5bae681d5585fb8c.tar.gz xine-lib-995d0f7e8a08bb813c24a49d5bae681d5585fb8c.tar.bz2 |
minor corrections and a patch for metronom to make sure it doesn't compensate drifts forever
CVS patchset: 1563
CVS date: 2002/03/12 11:04:06
Diffstat (limited to 'src/xine-engine/metronom.c')
-rw-r--r-- | src/xine-engine/metronom.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 7b2a544f6..adfba2f77 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.66 2002/03/12 01:35:54 miguelfreitas Exp $ + * $Id: metronom.c,v 1.67 2002/03/12 11:04:07 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -367,11 +367,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { } else { - /* this will fix video drift with a constant compensation each - frame for about 1 second of video. since a valid pts must - happen before that the difference will be recalculated, - resulting in a new (smaller) video_drift value. */ - this->video_drift = diff/30; + this->video_drift = diff; #ifdef LOG if (diff) @@ -388,7 +384,14 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { (this->video_drift<0)?'+':'-', abs(this->video_drift) ); #endif - img->duration -= this->video_drift; + /* 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; + if (this->video_drift<0) + this->video_drift = 0; + this->video_vpts += img->duration; pthread_mutex_unlock (&this->lock); |