From: Laurent Aimar Date: Sun, 7 Sep 2008 15:17:06 +0000 (+0200) Subject: Fixed vlc_cond_timedwait for win32. X-Git-Tag: 1.0.0-pre1~3470 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ecabf5dd58521b1e4d81a25623bf310afcff923a;p=vlc Fixed vlc_cond_timedwait for win32. Windows API expect a timeout in millisecond. SignaObjectAndWait should properly work with a 0 timeout, so try it. (avoid an invalid lock and an uninitialized return value). --- diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 7a265b0d4b..c61f6a91c9 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -447,9 +447,10 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line, { vlc_testcancel (); - mtime_t total = deadline - mdate (); - if (total <= 0) - break; + mtime_t total = (deadline - mdate ())/1000; + if( total < 0 ) + total = 0; + DWORD delay = (total > 0x7fffffff) ? 0x7fffffff : total; result = SignalObjectAndWait (*p_mutex, *p_condvar, delay, TRUE); }