summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-10-29 23:11:37 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-10-29 23:11:37 +0000
commit9320048966af54c31a0cc84f956460167c9bf882 (patch)
treed4f5be6027681950b65704d96f2f081f33a038e8 /src/xine-engine
parentcaf3f7a6dc518a95522dd18a9940387909d81d98 (diff)
downloadxine-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/xine-engine')
-rw-r--r--src/xine-engine/input_rip.c6
-rw-r--r--src/xine-engine/metronom.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c
index 18088ea87..bd0cbfd7f 100644
--- a/src/xine-engine/input_rip.c
+++ b/src/xine-engine/input_rip.c
@@ -29,7 +29,7 @@
* - it's possible speeder saving streams in the xine without playing:
* xine stream_mrl#save:file.raw\;noaudio\;novideo
*
- * $Id: input_rip.c,v 1.25 2004/09/26 22:54:52 valtri Exp $
+ * $Id: input_rip.c,v 1.26 2004/10/29 23:11:38 miguelfreitas Exp $
*/
/* TODO:
@@ -398,7 +398,7 @@ static off_t rip_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin)
}
/* read and catch remaining data after this->savepos */
- gettimeofday(&time1, NULL);
+ xine_monotonic_clock(&time1, NULL);
while (this->curpos < newpos && interval < SEEK_TIMEOUT) {
if( blocksize ) {
buf_element_t *buf;
@@ -418,7 +418,7 @@ static off_t rip_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin)
break;
}
}
- gettimeofday(&time2, NULL);
+ xine_monotonic_clock(&time2, NULL);
interval = (double)(time2.tv_sec - time1.tv_sec)
+ (double)(time2.tv_usec - time1.tv_usec) / 1000000;
}
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 4098f30cb..a0a628c1f 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.140 2004/08/02 12:51:21 miguelfreitas Exp $
+ * $Id: metronom.c,v 1.141 2004/10/29 23:11:38 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -92,7 +92,7 @@ static void unixscr_set_pivot (unixscr_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;
@@ -126,7 +126,7 @@ static void unixscr_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;
@@ -139,7 +139,7 @@ static void unixscr_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);
@@ -155,7 +155,7 @@ static int64_t unixscr_get_current (scr_plugin_t *scr) {
double pts_calc;
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;