diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-10-29 23:11:37 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-10-29 23:11:37 +0000 |
commit | 9320048966af54c31a0cc84f956460167c9bf882 (patch) | |
tree | d4f5be6027681950b65704d96f2f081f33a038e8 /src/input/input_v4l.c | |
parent | caf3f7a6dc518a95522dd18a9940387909d81d98 (diff) | |
download | xine-lib-9320048966af54c31a0cc84f956460167c9bf882.tar.gz xine-lib-9320048966af54c31a0cc84f956460167c9bf882.tar.bz2 |
use monotonic clock when available
CVS patchset: 7087
CVS date: 2004/10/29 23:11:37
Diffstat (limited to 'src/input/input_v4l.c')
-rw-r--r-- | src/input/input_v4l.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 73a765598..262c27441 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -241,7 +241,7 @@ static void pvrscr_set_pivot(pvrscr_t *this) int64_t pts; double pts_calc; - gettimeofday(&tv, NULL); + xine_monotonic_clock(&tv, NULL); pts_calc = (tv.tv_sec - this->cur_time.tv_sec) * this->speed_factor; pts_calc += (tv.tv_usec - this->cur_time.tv_usec) * this->speed_factor / 1e6; pts = this->cur_pts + pts_calc; @@ -291,7 +291,7 @@ static void pvrscr_adjust (scr_plugin_t *scr, int64_t vpts) pthread_mutex_lock (&this->lock); - gettimeofday(&tv, NULL); + xine_monotonic_clock(&tv, NULL); this->cur_time.tv_sec = tv.tv_sec; this->cur_time.tv_usec = tv.tv_usec; this->cur_pts = vpts; @@ -305,7 +305,7 @@ static void pvrscr_start (scr_plugin_t *scr, int64_t start_vpts) pthread_mutex_lock (&this->lock); - gettimeofday(&this->cur_time, NULL); + xine_monotonic_clock(&this->cur_time, NULL); this->cur_pts = start_vpts; pthread_mutex_unlock (&this->lock); @@ -322,7 +322,7 @@ static int64_t pvrscr_get_current (scr_plugin_t *scr) pthread_mutex_lock (&this->lock); - gettimeofday(&tv, NULL); + xine_monotonic_clock(&tv, NULL); pts_calc = (tv.tv_sec - this->cur_time.tv_sec) * this->speed_factor; pts_calc += (tv.tv_usec - this->cur_time.tv_usec) * this->speed_factor / 1e6; @@ -1208,7 +1208,7 @@ static off_t v4l_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { inline static int64_t get_time(void) { struct timeval tv; - gettimeofday(&tv,NULL); + xine_monotonic_clock(&tv,NULL); return (int64_t) tv.tv_sec * 90000 + (int64_t) tv.tv_usec * 9 / 100; } |