diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-08-05 22:51:53 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-08-05 22:51:53 +0100 |
commit | c579d6f6fb0fd0075faf02a80be1a24f7f75071a (patch) | |
tree | 9ecca7232b48a5e3421d48d10c9d9861f95c5b36 /src/xine-engine/demux.c | |
parent | c2c388cfc3258d237493df7e4efdfe2562abe78b (diff) | |
parent | 08c9d1d6bce967a909bb55a967bf694ce29b4f48 (diff) | |
download | xine-lib-c579d6f6fb0fd0075faf02a80be1a24f7f75071a.tar.gz xine-lib-c579d6f6fb0fd0075faf02a80be1a24f7f75071a.tar.bz2 |
Merge from 1.1.
--HG--
rename : src/libmusepack/xine_musepack_decoder.c => src/audio_dec/xine_musepack_decoder.c
Diffstat (limited to 'src/xine-engine/demux.c')
-rw-r--r-- | src/xine-engine/demux.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index ba43ddc60..fb4176763 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -122,10 +122,28 @@ 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; +#elif _POSIX_TIMERS > 0 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; +#else + struct timeval tv; + gettimeofday(&tv, NULL); + uint64_t ttimer = (uint64_t)tv.tv_sec*1000 + tv.tv_usec/1000 + millisecs; + ts.tv_sec = ttimer/1000; + ts.tv_nsec = (ttimer%1000)*1000000; +#endif return ts; } |