summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-02 14:54:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-02 15:02:20 +0100
commit7c9e7bd4257a97dfcd287f77c5d27f3c8a74da34 (patch)
tree98a69ae34c9377415b7b1cfba247d8ca5c382637 /libavcodec/pngenc.c
parent9b1755bce7fd38d7e2dcccb1aef4595cde60b54e (diff)
avcodec/pngenc: replace round by lrint()
Avoids passing double to AV_WB32() Suggested-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 9fd8eefd25..4e67ce2219 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -26,6 +26,7 @@
#include "png.h"
#include "libavutil/avassert.h"
+#include "libavutil/libm.h"
#include "libavutil/opt.h"
#include <zlib.h>
@@ -231,7 +232,7 @@ static int png_write_row(PNGEncContext *s, const uint8_t *data, int size)
return 0;
}
-#define AV_WB32_PNG(buf, n) (AV_WB32(buf, round((n) * 100000)))
+#define AV_WB32_PNG(buf, n) (AV_WB32(buf, lrint((n) * 100000)))
static int png_get_chrm(enum AVColorPrimaries prim, uint8_t *buf)
{
double rx, ry, gx, gy, bx, by, wx = 0.3127, wy = 0.3290;