diff mbox series

[FFmpeg-devel,1/3] avfilter/avf_showcqt: use av_gettime_relative() instead of av_gettime()

Message ID 20210207000423.8948-1-cus@passwd.hu
State Accepted
Commit 84094f017eba045dbb8643c1e0617c235e4f78df
Headers show
Series [FFmpeg-devel,1/3] avfilter/avf_showcqt: use av_gettime_relative() instead of av_gettime() | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Marton Balint Feb. 7, 2021, 12:04 a.m. UTC
av_gettime_relative() is using the monotonic clock therefore more suitable for
relative time calculations.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/avf_showcqt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marton Balint Feb. 27, 2021, 8:46 p.m. UTC | #1
On Sun, 7 Feb 2021, Marton Balint wrote:

> av_gettime_relative() is using the monotonic clock therefore more suitable for
> relative time calculations.

Applied.

Regards,
Marton

>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavfilter/avf_showcqt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
> index 115174a9b4..dba1f089ee 100644
> --- a/libavfilter/avf_showcqt.c
> +++ b/libavfilter/avf_showcqt.c
> @@ -1133,11 +1133,11 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout)
>     int64_t last_time, cur_time;
> 
> #define UPDATE_TIME(t) \
> -    cur_time = av_gettime(); \
> +    cur_time = av_gettime_relative(); \
>     t += cur_time - last_time; \
>     last_time = cur_time
> 
> -    last_time = av_gettime();
> +    last_time = av_gettime_relative();
>
>     memcpy(s->fft_result, s->fft_data, s->fft_len * sizeof(*s->fft_data));
>     if (s->attack_data) {
> -- 
> 2.26.2
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
index 115174a9b4..dba1f089ee 100644
--- a/libavfilter/avf_showcqt.c
+++ b/libavfilter/avf_showcqt.c
@@ -1133,11 +1133,11 @@  static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout)
     int64_t last_time, cur_time;
 
 #define UPDATE_TIME(t) \
-    cur_time = av_gettime(); \
+    cur_time = av_gettime_relative(); \
     t += cur_time - last_time; \
     last_time = cur_time
 
-    last_time = av_gettime();
+    last_time = av_gettime_relative();
 
     memcpy(s->fft_result, s->fft_data, s->fft_len * sizeof(*s->fft_data));
     if (s->attack_data) {