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
8fd56f7b
Commit
8fd56f7b
authored
Oct 08, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eval: make variables persistent so they can be used between evaluations.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
74f77eb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
eval.c
libavutil/eval.c
+5
-1
No files found.
libavutil/eval.c
View file @
8fd56f7b
...
...
@@ -44,7 +44,7 @@ typedef struct Parser {
int
log_offset
;
void
*
log_ctx
;
#define VARS 10
double
var
[
VARS
]
;
double
*
var
;
}
Parser
;
static
const
AVClass
class
=
{
"Eval"
,
av_default_item_name
,
NULL
,
LIBAVUTIL_VERSION_INT
,
offsetof
(
Parser
,
log_offset
),
offsetof
(
Parser
,
log_ctx
)
};
...
...
@@ -136,6 +136,7 @@ struct AVExpr {
double
(
*
func2
)(
void
*
,
double
,
double
);
}
a
;
struct
AVExpr
*
param
[
2
];
double
*
var
;
};
static
double
eval_expr
(
Parser
*
p
,
AVExpr
*
e
)
...
...
@@ -190,6 +191,7 @@ void av_expr_free(AVExpr *e)
if
(
!
e
)
return
;
av_expr_free
(
e
->
param
[
0
]);
av_expr_free
(
e
->
param
[
1
]);
av_freep
(
&
e
->
var
);
av_freep
(
&
e
);
}
...
...
@@ -510,6 +512,7 @@ int av_expr_parse(AVExpr **expr, const char *s,
ret
=
AVERROR
(
EINVAL
);
goto
end
;
}
e
->
var
=
av_mallocz
(
sizeof
(
double
)
*
VARS
);
*
expr
=
e
;
end:
av_free
(
w
);
...
...
@@ -519,6 +522,7 @@ end:
double
av_expr_eval
(
AVExpr
*
e
,
const
double
*
const_values
,
void
*
opaque
)
{
Parser
p
=
{
0
};
p
.
var
=
e
->
var
;
p
.
const_values
=
const_values
;
p
.
opaque
=
opaque
;
...
...
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