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/fbdev_dec.c | |
parent | 529bf5daf2935fb87787d7f7a5263e1b254d59d2 (diff) |
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/fbdev_dec.c')
-rw-r--r-- | libavdevice/fbdev_dec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavdevice/fbdev_dec.c b/libavdevice/fbdev_dec.c index 6a51816868..586caeef88 100644 --- a/libavdevice/fbdev_dec.c +++ b/libavdevice/fbdev_dec.c @@ -157,11 +157,11 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) uint8_t *pin, *pout; if (fbdev->time_frame == AV_NOPTS_VALUE) - fbdev->time_frame = av_gettime(); + fbdev->time_frame = av_gettime_relative(); /* wait based on the frame rate */ while (1) { - curtime = av_gettime(); + curtime = av_gettime_relative(); delay = fbdev->time_frame - curtime; av_log(avctx, AV_LOG_TRACE, "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n", @@ -186,7 +186,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) "Error refreshing variable info: %s\n", av_err2str(AVERROR(errno))); } - pkt->pts = curtime; + pkt->pts = av_gettime(); /* compute visible data offset */ pin = fbdev->data + fbdev->bytes_per_pixel * fbdev->varinfo.xoffset + |