From: Jiangjie Gao <[email protected]>
---
libavutil/time.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavutil/time.c b/libavutil/time.c
index 740afc4785..dd04870983 100644
--- a/libavutil/time.c
+++ b/libavutil/time.c
@@ -90,7 +90,16 @@ int av_usleep(unsigned usec)
#elif HAVE_USLEEP
return usleep(usec);
#elif HAVE_SLEEP
- Sleep(usec / 1000);
+ if (usec > 10000) {
+ Sleep(usec / 1000);
+ } else {
+ LARGE_INTEGER t;
+ t.QuadPart = -(10 * (LONGLONG)usec);
+ HANDLE timer = CreateWaitableTimer(NULL, TRUE, NULL);
+ SetWaitableTimer(timer, &t, 0, NULL, NULL, 0);
+ WaitForSingleObject(timer, INFINITE);
+ CloseHandle(timer);
+ }
return 0;
#else
return AVERROR(ENOSYS);
--
2.27.0.windows.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".