From 7fd41fdc35e649f95ae00e79fa4e2069f50d2fab Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 24 Sep 2006 15:16:33 +0000 Subject: [PATCH] Windows mods on new threadscan code --- player.cc | 18 +++++++++++++++++- player.h | 4 ++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/player.cc b/player.cc index ca9657f..adfc5b7 100644 --- a/player.cc +++ b/player.cc @@ -1020,15 +1020,25 @@ void Player::threadFeedScan() ULONG iframesep; +#ifndef _MSC_VER struct timeval loopTime; struct timeval loopTimeN; +#else + DWORD loopTime; + DWORD loopTimeN; +#endif + ULONG realLoopTime; ULONG sleepTime = 0; UINT offset; if (state == S_FFWD) direction = 1; // and 0 for backward - gettimeofday(&loopTime, NULL); + #ifndef WIN32 + gettimeofday(&loopTime, NULL); + #else + loopTime = timeGetTime(); + #endif while(1) { @@ -1043,10 +1053,16 @@ void Player::threadFeedScan() threadCheckExit(); // Calculate next jump delay +#ifndef WIN32 gettimeofday(&loopTimeN, NULL); realLoopTime = ((loopTimeN.tv_sec - loopTime.tv_sec) * 1000) + ((loopTimeN.tv_usec - loopTime.tv_usec) / 1000); loopTime.tv_sec = loopTimeN.tv_sec; loopTime.tv_usec = loopTimeN.tv_usec; +#else + loopTimeN = timeGetTime(); + realLoopTime = loopTimeN - loopTime; + loopTime = loopTimeN; +#endif offset = 0; if (sleepTime) offset = realLoopTime - sleepTime; diff --git a/player.h b/player.h index 7253cf6..ab96c6e 100644 --- a/player.h +++ b/player.h @@ -23,7 +23,9 @@ #include #include +#ifndef WIN32 #include +#endif #include #include "audio.h" @@ -192,3 +194,5 @@ Jump -> Play -> FFwd -> FBwd -> Stop + +*/ -- 2.39.5