[MPlayer-cygwin] Precise timing for windows

Arpi arpi at thot.banki.hu
Wed Mar 26 11:37:11 CET 2003


Hi,

> I found a patch in the archives, and Arpi told that it may not work on 
> never/recent Windows versions, becouse it uses an ancient (Win95/98)
> library, named winmm.

btw i've just found my old code, used in Astral demo engine's win32 build:
(actually contents of linux (now osdep/) comes from my old projects, like
the astral demo engine and mailer3 :))

// Precise timer routines for WINDOWS
#include <mmsystem.h>
//#include <conio.h>
#include "timer.h"

DWORD WINAPI timeGetTime(void);

// Returns current time in seconds
inline float GetTimer(){
  return (float)timeGetTime() * 0.001;
}

// Returns current time in microseconds
inline int uGetTimer(){
  return timeGetTime() * 1000;
}

(the rest (like usec_sleep etc) were not implemented in my code, they are
mplayer specific.)

So, instead of complicated QueryPerformanceCounter() stuff in the patch Alex
attached, a simple timeGetTime() could be used.
(but i'm not sure how the new windows versions support it, our win32 demo
build ran only on win98)


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu


More information about the MPlayer-cygwin mailing list