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
408ea50c
Commit
408ea50c
authored
Feb 10, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/f_metadata: fix few logic errors
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
5f1aad68
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
filters.texi
doc/filters.texi
+2
-2
f_metadata.c
libavfilter/f_metadata.c
+6
-6
No files found.
doc/filters.texi
View file @
408ea50c
...
...
@@ -8501,13 +8501,13 @@ Values are interpreted as strings, returns true if @code{value} is same as metad
to N chars as set in @code{length} option.
@item less
Values are interpreted as floats, returns true if
@code{value} is less than metadata value
.
Values are interpreted as floats, returns true if
metadata value is less than @code{value}
.
@item equal
Values are interpreted as floats, returns true if @code{value} is equal with metadata value.
@item greater
Values are interpreted as floats, returns true if
@code{value} is greater than metadata value
.
Values are interpreted as floats, returns true if
metadata value is greater than @code{value}
.
@item expr
Values are interpreted as floats, returns true if expression from option @code{expr}
...
...
libavfilter/f_metadata.c
View file @
408ea50c
...
...
@@ -127,7 +127,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
;
}
static
int
greater
(
MetadataContext
*
s
,
const
char
*
value1
,
const
char
*
value2
,
size_t
length
)
...
...
@@ -137,7 +137,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
f1
>
f2
;
}
static
int
parse_expr
(
MetadataContext
*
s
,
const
char
*
value1
,
const
char
*
value2
,
size_t
length
)
...
...
@@ -148,7 +148,7 @@ static int parse_expr(MetadataContext *s, const char *value1, const char *value2
return
0
;
s
->
var_values
[
VAR_VALUE1
]
=
f1
;
s
->
var_values
[
VAR_VALUE
1
]
=
f2
;
s
->
var_values
[
VAR_VALUE
2
]
=
f2
;
return
av_expr_eval
(
s
->
expr
,
s
->
var_values
,
NULL
);
}
...
...
@@ -223,7 +223,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if
(
!
s
->
value
&&
e
&&
e
->
value
)
{
return
ff_filter_frame
(
outlink
,
frame
);
}
else
if
(
s
->
value
&&
e
&&
e
->
value
&&
s
->
compare
(
s
,
s
->
value
,
e
->
value
,
s
->
length
))
{
s
->
compare
(
s
,
e
->
value
,
s
->
value
,
s
->
length
))
{
return
ff_filter_frame
(
outlink
,
frame
);
}
break
;
...
...
@@ -248,14 +248,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
while
((
e
=
av_dict_get
(
metadata
,
""
,
e
,
AV_DICT_IGNORE_SUFFIX
))
!=
NULL
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
"%s=%s
\n
"
,
e
->
key
,
e
->
value
);
}
}
else
if
(
e
&&
e
->
value
&&
(
!
s
->
value
||
(
e
->
value
&&
s
->
compare
(
s
,
s
->
value
,
e
->
value
,
s
->
length
))))
{
}
else
if
(
e
&&
e
->
value
&&
(
!
s
->
value
||
(
e
->
value
&&
s
->
compare
(
s
,
e
->
value
,
s
->
value
,
s
->
length
))))
{
av_log
(
ctx
,
AV_LOG_INFO
,
"frame %"
PRId64
" pts %"
PRId64
"
\n
"
,
inlink
->
frame_count
,
frame
->
pts
);
av_log
(
ctx
,
AV_LOG_INFO
,
"%s=%s
\n
"
,
s
->
key
,
e
->
value
);
}
return
ff_filter_frame
(
outlink
,
frame
);
break
;
case
METADATA_DELETE
:
if
(
e
&&
e
->
value
&&
s
->
value
&&
s
->
compare
(
s
,
s
->
value
,
e
->
value
,
s
->
length
))
{
if
(
e
&&
e
->
value
&&
s
->
value
&&
s
->
compare
(
s
,
e
->
value
,
s
->
value
,
s
->
length
))
{
av_dict_set
(
&
metadata
,
s
->
key
,
NULL
,
0
);
}
else
if
(
e
&&
e
->
value
)
{
av_dict_set
(
&
metadata
,
s
->
key
,
NULL
,
0
);
...
...
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