[FFmpeg-devel] [PATCH 05/11] avformat/mp3dec: use FFABS to instead of abs

Steven Liu lq at chinaffmpeg.org
Wed Nov 15 09:44:17 EET 2017


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/mp3dec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index a5c4f2ea12..a76fe32e59 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -508,9 +508,9 @@ static int64_t mp3_sync(AVFormatContext *s, int64_t target_pos, int flags)
                     return AVERROR(EINVAL);
                 }
             }
-            if ((target_pos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) {
+            if ((target_pos - pos)*dir <= 0 && FFABS(MIN_VALID/2-j) < score) {
                 candidate = pos;
-                score = abs(MIN_VALID/2-j);
+                score = FFABS(MIN_VALID/2-j);
             }
             pos += ret;
         }
-- 
2.11.0 (Apple Git-81)





More information about the ffmpeg-devel mailing list