diff options
author | Marton Balint <cus@passwd.hu> | 2021-02-07 00:55:25 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2021-02-27 21:41:50 +0100 |
commit | 2d32aed85c4874a2596202b6f0c08e6ce49e3bca (patch) | |
tree | 3a59a78746a61ffa1bcf93774d6e4ef009bf3fc7 /libavdevice/bktr.c | |
parent | 529bf5daf2935fb87787d7f7a5263e1b254d59d2 (diff) | |
download | ffmpeg-2d32aed85c4874a2596202b6f0c08e6ce49e3bca.tar.gz |
avdevice: use av_gettime_relative() for elapsed time calculations
av_gettime_relative() is using the monotonic clock therefore more suitable for
elapsed time calculations. Packet timestamps are still kept absolute, although
that should be configurable in the future.
Related to ticket #9089.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavdevice/bktr.c')
-rw-r--r-- | libavdevice/bktr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index 2601adbba8..0688028f90 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -225,14 +225,14 @@ static void bktr_getframe(uint64_t per_frame) { uint64_t curtime; - curtime = av_gettime(); + curtime = av_gettime_relative(); if (!last_frame_time || ((last_frame_time + per_frame) > curtime)) { if (!usleep(last_frame_time + per_frame + per_frame / 8 - curtime)) { if (!nsignals) av_log(NULL, AV_LOG_INFO, "SLEPT NO signals - %d microseconds late\n", - (int)(av_gettime() - last_frame_time - per_frame)); + (int)(av_gettime_relative() - last_frame_time - per_frame)); } } nsignals = 0; |