Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
x264
Commits
d1a53926
Commit
d1a53926
authored
Jun 25, 2018
by
Henrik Gramner
Browse files
Prefer a monotonic clock source if available
parent
1d18f0e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
common/osdep.c
View file @
d1a53926
...
...
@@ -51,6 +51,10 @@ int64_t x264_mdate( void )
struct
timeb
tb
;
ftime
(
&
tb
);
return
((
int64_t
)
tb
.
time
*
1000
+
(
int64_t
)
tb
.
millitm
)
*
1000
;
#elif HAVE_CLOCK_GETTIME
struct
timespec
ts
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
ts
);
return
(
int64_t
)
ts
.
tv_sec
*
1000000
+
(
int64_t
)
ts
.
tv_nsec
/
1000
;
#else
struct
timeval
tv_date
;
gettimeofday
(
&
tv_date
,
NULL
);
...
...
configure
View file @
d1a53926
...
...
@@ -396,7 +396,7 @@ NL="
# list of all preprocessor HAVE values we can define
CONFIG_HAVE
=
"MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F SWSCALE
\
LAVF FFMS GPAC AVS GPL VECTOREXT INTERLACED CPU_COUNT OPENCL THP LSMASH X86_INLINE_ASM AS_FUNC INTEL_DISPATCHER
\
MSA MMAP WINRT VSX ARM_INLINE_ASM STRTOK_R BITDEPTH8 BITDEPTH10"
MSA MMAP WINRT VSX ARM_INLINE_ASM STRTOK_R
CLOCK_GETTIME
BITDEPTH8 BITDEPTH10"
# parse options
...
...
@@ -1075,6 +1075,13 @@ if cc_check 'string.h' '' 'strtok_r(0, 0, 0);' ; then
define HAVE_STRTOK_R
fi
if
cc_check
'time.h'
''
'clock_gettime(CLOCK_MONOTONIC, 0);'
;
then
define HAVE_CLOCK_GETTIME
elif
cc_check
'time.h'
'-lrt'
'clock_gettime(CLOCK_MONOTONIC, 0);'
;
then
define HAVE_CLOCK_GETTIME
LDFLAGS
=
"
$LDFLAGS
-lrt"
fi
if
[
"
$SYS
"
!=
"WINDOWS"
]
&&
cpp_check
"sys/mman.h unistd.h"
""
"defined(MAP_PRIVATE)"
;
then
define HAVE_MMAP
fi
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment