[FFmpeg-devel] [PATCH 04/12] lavfi/vf_drawtext: replace round by llrint

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sat Dec 19 06:45:30 CET 2015


llrint is at least as fast, and better accuracy wise.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavfilter/vf_drawtext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index fc77be4..d5770ad 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -812,7 +812,7 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
         if (isnan(pts)) {
             av_bprintf(bp, " ??:??:??.???");
         } else {
-            int64_t ms = round(pts * 1000);
+            int64_t ms = llrint(pts * 1000);
             char sign = ' ';
             if (ms < 0) {
                 sign = '-';
-- 
2.6.4



More information about the ffmpeg-devel mailing list