summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--m4/pthreads.m42
-rw-r--r--src/xine-engine/demux.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/m4/pthreads.m4 b/m4/pthreads.m4
index d1d1c0a62..6cbed9255 100644
--- a/m4/pthreads.m4
+++ b/m4/pthreads.m4
@@ -18,6 +18,7 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [
dnl if PTHREAD_* are not set, default to -pthread (GCC)
if test "${PTHREAD_CFLAGS-unset}" = "unset"; then
case $host in
+ *-mingw*) PTHREAD_CFLAGS="" ;;
*-hpux11*) PTHREAD_CFLAGS="" ;;
*-darwin*) PTHREAD_CFLAGS="" ;;
*-solaris*|*-linux-gnu)
@@ -29,6 +30,7 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [
fi
if test "${PTHREAD_LIBS-unset}" = "unset"; then
case $host in
+ *-mingw*) PTHREAD_LIBS="-lpthreadGC2" ;;
*-hpux11*) PTHREAD_LIBS="-lpthread" ;;
*-darwin*) PTHREAD_LIBS="" ;;
*-solaris*)
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;
}