diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-27 19:15:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 19:15:26 +0200 |
commit | c75dae3ed21bfa5a8ae46cd83d18329af5bea05a (patch) | |
tree | ef657c38feb2368a3c86765778d1f068aa5eb614 /media/ffvpx/libavutil/time.c | |
parent | c82c6d960a7f19d6595171f9705c43514f20c1ec (diff) | |
parent | 6ada4b14e4cfc91f5f1b2556623cab691f3ab813 (diff) | |
download | UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar.gz UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar.lz UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.tar.xz UXP-c75dae3ed21bfa5a8ae46cd83d18329af5bea05a.zip |
Merge pull request #275 from trav90/ffvpx-resync
Resync ffvpx code with 3.4.2-release from upstream
Diffstat (limited to 'media/ffvpx/libavutil/time.c')
-rw-r--r-- | media/ffvpx/libavutil/time.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/media/ffvpx/libavutil/time.c b/media/ffvpx/libavutil/time.c index 69419e6f3..80d1faf26 100644 --- a/media/ffvpx/libavutil/time.c +++ b/media/ffvpx/libavutil/time.c @@ -56,17 +56,25 @@ int64_t av_gettime(void) int64_t av_gettime_relative(void) { #if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (int64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; -#else - return av_gettime() + 42 * 60 * 60 * INT64_C(1000000); +#ifdef __APPLE__ + if (clock_gettime) +#endif + { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (int64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + } #endif + return av_gettime() + 42 * 60 * 60 * INT64_C(1000000); } int av_gettime_relative_is_monotonic(void) { #if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) +#ifdef __APPLE__ + if (!clock_gettime) + return 0; +#endif return 1; #else return 0; |