summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlo Bramini <carlo.bramix@libero.it>2009-04-22 18:30:00 +0000
committerCarlo Bramini <carlo.bramix@libero.it>2009-04-22 18:30:00 +0000
commitad7e0f22ba57690d69016d27c05484e87c0ef28e (patch)
tree1530ede9744d2f0b095c5ce5ec7aa3181629cb00 /src
parent7449244be479be3437f822a99c12d8597176e1af (diff)
downloadxine-lib-ad7e0f22ba57690d69016d27c05484e87c0ef28e.tar.gz
xine-lib-ad7e0f22ba57690d69016d27c05484e87c0ef28e.tar.bz2
Demux timing fixes (Windows)
m4/pthreads.m4 * Mingw GCC says that '-pthread' option is unknown. * Correct library name under Mingw is -lpthreadGC2. src/xine-engine/demux.c * function _x_compute_interval cannot be compiled
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/demux.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 698b44988..158e0706f 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -122,10 +122,22 @@ void _x_demux_flush_engine (xine_stream_t *stream) {
static struct timespec _x_compute_interval(unsigned int millisecs) {
struct timespec ts;
+#ifdef WIN32
+ FILETIME ft;
+ ULARGE_INTEGER ui;
+
+ GetSystemTimeAsFileTime(&ft);
+ ui.u.LowPart = ft.dwLowDateTime;
+ ui.u.HighPart = ft.dwHighDateTime;
+ ui.QuadPart += millisecs * 10000;
+ ts.tv_sec = ui.QuadPart / 10000000;
+ ts.tv_sec = (ui.QuadPart % 10000000)*100;
+#else
clock_gettime(CLOCK_REALTIME, &ts);
uint64_t ttimer = (uint64_t)ts.tv_sec*1000 + ts.tv_nsec/1000000 + millisecs;
ts.tv_sec = ttimer/1000;
ts.tv_nsec = (ttimer%1000)*1000000;
+#endif
return ts;
}