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
d3044cf3
Commit
d3044cf3
authored
Mar 21, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt-test: Move some variable declarations to avoid block braces
parent
a84713e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
36 deletions
+35
-36
opt.c
libavutil/opt.c
+35
-36
No files found.
libavutil/opt.c
View file @
d3044cf3
...
@@ -801,46 +801,45 @@ static const AVClass test_class = {
...
@@ -801,46 +801,45 @@ static const AVClass test_class = {
int
main
(
void
)
int
main
(
void
)
{
{
int
i
;
int
i
;
TestContext
test_ctx
;
const
char
*
options
[]
=
{
""
,
":"
,
"="
,
"foo=:"
,
":=foo"
,
"=foo"
,
"foo="
,
"foo"
,
"foo=val"
,
"foo==val"
,
"toggle=:"
,
"string=:"
,
"toggle=1 : foo"
,
"toggle=100"
,
"toggle==1"
,
"flags=+mu-lame : num=42: toggle=0"
,
"num=42 : string=blahblah"
,
"rational=0 : rational=1/2 : rational=1/-1"
,
"rational=-1/0"
,
};
test_ctx
.
class
=
&
test_class
;
printf
(
"
\n
Testing av_set_options_string()
\n
"
);
printf
(
"
\n
Testing av_set_options_string()
\n
"
);
{
TestContext
test_ctx
;
const
char
*
options
[]
=
{
""
,
":"
,
"="
,
"foo=:"
,
":=foo"
,
"=foo"
,
"foo="
,
"foo"
,
"foo=val"
,
"foo==val"
,
"toggle=:"
,
"string=:"
,
"toggle=1 : foo"
,
"toggle=100"
,
"toggle==1"
,
"flags=+mu-lame : num=42: toggle=0"
,
"num=42 : string=blahblah"
,
"rational=0 : rational=1/2 : rational=1/-1"
,
"rational=-1/0"
,
};
test_ctx
.
class
=
&
test_class
;
av_opt_set_defaults
(
&
test_ctx
);
test_ctx
.
string
=
av_strdup
(
"default"
);
if
(
!
test_ctx
.
string
)
return
AVERROR
(
ENOMEM
);
av_log_set_level
(
AV_LOG_DEBUG
);
av_opt_set_defaults
(
&
test_ctx
);
test_ctx
.
string
=
av_strdup
(
"default"
);
if
(
!
test_ctx
.
string
)
return
AVERROR
(
ENOMEM
);
av_log_set_level
(
AV_LOG_DEBUG
);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
options
);
i
++
)
{
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
options
);
i
++
)
{
av_log
(
&
test_ctx
,
AV_LOG_DEBUG
,
"Setting options string '%s'
\n
"
,
options
[
i
]);
av_log
(
&
test_ctx
,
AV_LOG_DEBUG
,
"Setting options string '%s'
\n
"
,
options
[
i
]);
if
(
av_set_options_string
(
&
test_ctx
,
options
[
i
],
"="
,
":"
)
<
0
)
if
(
av_set_options_string
(
&
test_ctx
,
options
[
i
],
"="
,
":"
)
<
0
)
av_log
(
&
test_ctx
,
AV_LOG_ERROR
,
"Error setting options string: '%s'
\n
"
,
options
[
i
]);
av_log
(
&
test_ctx
,
AV_LOG_ERROR
,
"Error setting options string: '%s'
\n
"
,
options
[
i
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
}
return
0
;
return
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