Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8b99c5e8
Commit
8b99c5e8
authored
Feb 11, 2016
by
Tobias Rapp
Committed by
Paul B Mahol
Feb 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/f_metadata: avoid float rounding problems
Signed-off-by:
Tobias Rapp
<
t.rapp@noa-archive.com
>
parent
ac3a275d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
f_metadata.c
libavfilter/f_metadata.c
+5
-3
No files found.
libavfilter/f_metadata.c
View file @
8b99c5e8
...
...
@@ -23,6 +23,8 @@
* filter for manipulating frame metadata
*/
#include <float.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
...
...
@@ -117,7 +119,7 @@ static int equal(MetadataContext *s, const char *value1, const char *value2, siz
if
(
sscanf
(
value1
,
"%f"
,
&
f1
)
+
sscanf
(
value2
,
"%f"
,
&
f2
)
!=
2
)
return
0
;
return
f
1
==
f2
;
return
f
absf
(
f1
-
f2
)
<
FLT_EPSILON
;
}
static
int
less
(
MetadataContext
*
s
,
const
char
*
value1
,
const
char
*
value2
,
size_t
length
)
...
...
@@ -127,7 +129,7 @@ static int less(MetadataContext *s, const char *value1, const char *value2, size
if
(
sscanf
(
value1
,
"%f"
,
&
f1
)
+
sscanf
(
value2
,
"%f"
,
&
f2
)
!=
2
)
return
0
;
return
f1
<
f2
;
return
(
f1
-
f2
)
<
FLT_EPSILON
;
}
static
int
greater
(
MetadataContext
*
s
,
const
char
*
value1
,
const
char
*
value2
,
size_t
length
)
...
...
@@ -137,7 +139,7 @@ static int greater(MetadataContext *s, const char *value1, const char *value2, s
if
(
sscanf
(
value1
,
"%f"
,
&
f1
)
+
sscanf
(
value2
,
"%f"
,
&
f2
)
!=
2
)
return
0
;
return
f1
>
f2
;
return
(
f2
-
f1
)
<
FLT_EPSILON
;
}
static
int
parse_expr
(
MetadataContext
*
s
,
const
char
*
value1
,
const
char
*
value2
,
size_t
length
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment