mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-09 01:21:06 +00:00
lavu: monotonic av_gettime_relative for msvc
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user