diff --git a/libavutil/time.c b/libavutil/time.c index 740afc4785..e34f2a3b81 100644 --- a/libavutil/time.c +++ b/libavutil/time.c @@ -35,6 +35,7 @@ #include "time.h" #include "error.h" +#include "mathematics.h" int64_t av_gettime(void) { @@ -64,6 +65,12 @@ int64_t av_gettime_relative(void) clock_gettime(CLOCK_MONOTONIC, &ts); return (int64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; } +#elif defined(_WIN32) + LARGE_INTEGER freq; + LARGE_INTEGER counter; + QueryPerformanceFrequency(&freq); + QueryPerformanceCounter(&counter); + return av_rescale(counter.QuadPart, 1000000, freq.QuadPart); #endif return av_gettime() + 42 * 60 * 60 * INT64_C(1000000); } @@ -76,6 +83,8 @@ int av_gettime_relative_is_monotonic(void) return 0; #endif return 1; +#elif defined(_WIN32) + return 1; #else return 0; #endif