[FFmpeg-cvslog] tests/audiomatch: removes a warning when compiling tests/audiomatch
Steven Liu
git at videolan.org
Mon Oct 26 06:18:36 EET 2020
ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Mon Oct 19 14:05:36 2020 +0800| [bc90145fa3b6e8d26dafe057252a17cdd3a9a095] | committer: liuqi05
tests/audiomatch: removes a warning when compiling tests/audiomatch
the warning message:
warning: using floating point absolute value function
'fabs' when argument is of integer type
use FFABS to set the absolute value.
Signed-off-by: liuqi05 <liuqi05 at kuaishou.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc90145fa3b6e8d26dafe057252a17cdd3a9a095
---
tests/audiomatch.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/audiomatch.c b/tests/audiomatch.c
index d44c4070e0..bb9deca624 100644
--- a/tests/audiomatch.c
+++ b/tests/audiomatch.c
@@ -24,6 +24,7 @@
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
static int64_t fsize(FILE *f) {
int64_t end, pos = ftell(f);
@@ -101,9 +102,9 @@ int main(int argc, char **argv) {
int j = pos + i;
c += signal[i] * data[j];
}
- if (fabs(c) > sigamp * 0.94)
- maxshift = FFMIN(maxshift, fabs(pos)+32);
- if (fabs(c) > fabs(bestc)) {
+ if (FFABS(c) > sigamp * 0.94)
+ maxshift = FFMIN(maxshift, FFABS(pos)+32);
+ if (FFABS(c) > FFABS(bestc)) {
bestc = c;
bestpos = pos;
}
More information about the ffmpeg-cvslog
mailing list