[vlc-devel] commit: Fixed mwait for windows. (Laurent Aimar )
git version control
git at videolan.org
Thu Sep 4 20:54:29 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Sep 4 20:46:07 2008 +0200| [e7ba995b029cadfeefcb8e69e707f8acaacc52ca] | committer: Laurent Aimar
Fixed mwait for windows.
SleepEx expects a duration in milli second.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7ba995b029cadfeefcb8e69e707f8acaacc52ca
---
src/misc/mtime.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index d9cb505..2eb81f6 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -342,15 +342,16 @@ void mwait( mtime_t date )
}
#elif defined (WIN32)
- mtime_t total;
+ mtime_t i_total;
- while ((total = (date - mdate ())) > 0)
+ while( (i_total = (date - mdate())) > 0 )
{
- DWORD delay = (total > 0x7fffffff) ? 0x7fffffff : total;
- vlc_testcancel ();
- SleepEx (delay, TRUE);
+ const mtime_t i_sleep = i_total / 1000;
+ DWORD i_delay = (i_sleep > 0x7fffffff) ? 0x7fffffff : i_sleep;
+ vlc_testcancel();
+ SleepEx( i_delay, TRUE );
}
- vlc_testcancel ();
+ vlc_testcancel();
#else
mtime_t delay = date - mdate();
More information about the vlc-devel
mailing list