Commit 7c9e7bd4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pngenc: replace round by lrint()

Avoids passing double to AV_WB32()
Suggested-by: 's avatar"Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9b1755bc
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "png.h" #include "png.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/libm.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include <zlib.h> #include <zlib.h>
...@@ -231,7 +232,7 @@ static int png_write_row(PNGEncContext *s, const uint8_t *data, int size) ...@@ -231,7 +232,7 @@ static int png_write_row(PNGEncContext *s, const uint8_t *data, int size)
return 0; 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) static int png_get_chrm(enum AVColorPrimaries prim, uint8_t *buf)
{ {
double rx, ry, gx, gy, bx, by, wx = 0.3127, wy = 0.3290; double rx, ry, gx, gy, bx, by, wx = 0.3127, wy = 0.3290;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment