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
0ad654d4
Commit
0ad654d4
authored
Dec 08, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/opt: perform misc cosmetical fixes
parent
642a60f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
opt.c
libavutil/opt.c
+13
-10
No files found.
libavutil/opt.c
View file @
0ad654d4
...
@@ -826,14 +826,14 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
...
@@ -826,14 +826,14 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%c"
,
(
opt
->
flags
&
AV_OPT_FLAG_AUDIO_PARAM
)
?
'A'
:
'.'
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%c"
,
(
opt
->
flags
&
AV_OPT_FLAG_AUDIO_PARAM
)
?
'A'
:
'.'
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%c"
,
(
opt
->
flags
&
AV_OPT_FLAG_SUBTITLE_PARAM
)
?
'S'
:
'.'
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%c"
,
(
opt
->
flags
&
AV_OPT_FLAG_SUBTITLE_PARAM
)
?
'S'
:
'.'
);
if
(
av_opt_query_ranges
(
&
r
,
obj
,
opt
->
name
,
AV_OPT_SEARCH_FAKE_OBJ
)
>=
0
)
{
if
(
av_opt_query_ranges
(
&
r
,
obj
,
opt
->
name
,
AV_OPT_SEARCH_FAKE_OBJ
)
>=
0
)
{
switch
(
opt
->
type
)
{
switch
(
opt
->
type
)
{
case
AV_OPT_TYPE_INT
:
case
AV_OPT_TYPE_INT
:
case
AV_OPT_TYPE_INT64
:
case
AV_OPT_TYPE_INT64
:
case
AV_OPT_TYPE_DOUBLE
:
case
AV_OPT_TYPE_DOUBLE
:
case
AV_OPT_TYPE_FLOAT
:
case
AV_OPT_TYPE_FLOAT
:
case
AV_OPT_TYPE_RATIONAL
:
case
AV_OPT_TYPE_RATIONAL
:
for
(
i
=
0
;
i
<
r
->
nb_ranges
;
i
++
)
{
for
(
i
=
0
;
i
<
r
->
nb_ranges
;
i
++
)
{
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"["
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"["
);
log_value
(
av_log_obj
,
AV_LOG_INFO
,
r
->
range
[
i
]
->
value_min
);
log_value
(
av_log_obj
,
AV_LOG_INFO
,
r
->
range
[
i
]
->
value_min
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
", "
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
", "
);
...
@@ -1208,20 +1208,22 @@ void *av_opt_ptr(const AVClass *class, void *obj, const char *name)
...
@@ -1208,20 +1208,22 @@ void *av_opt_ptr(const AVClass *class, void *obj, const char *name)
return
(
uint8_t
*
)
obj
+
opt
->
offset
;
return
(
uint8_t
*
)
obj
+
opt
->
offset
;
}
}
int
av_opt_query_ranges
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
{
int
av_opt_query_ranges
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
{
const
AVClass
*
c
=
*
(
AVClass
**
)
obj
;
const
AVClass
*
c
=
*
(
AVClass
**
)
obj
;
int
(
*
callback
)(
AVOptionRanges
**
,
void
*
obj
,
const
char
*
key
,
int
flags
)
=
NULL
;
int
(
*
callback
)(
AVOptionRanges
**
,
void
*
obj
,
const
char
*
key
,
int
flags
)
=
NULL
;
if
(
c
->
version
>
(
52
<<
16
|
11
<<
8
))
if
(
c
->
version
>
(
52
<<
16
|
11
<<
8
))
callback
=
c
->
query_ranges
;
callback
=
c
->
query_ranges
;
if
(
!
callback
)
if
(
!
callback
)
callback
=
av_opt_query_ranges_default
;
callback
=
av_opt_query_ranges_default
;
return
callback
(
ranges_arg
,
obj
,
key
,
flags
);
return
callback
(
ranges_arg
,
obj
,
key
,
flags
);
}
}
int
av_opt_query_ranges_default
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
{
int
av_opt_query_ranges_default
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
{
AVOptionRanges
*
ranges
=
av_mallocz
(
sizeof
(
*
ranges
));
AVOptionRanges
*
ranges
=
av_mallocz
(
sizeof
(
*
ranges
));
AVOptionRange
**
range_array
=
av_mallocz
(
sizeof
(
void
*
));
AVOptionRange
**
range_array
=
av_mallocz
(
sizeof
(
void
*
));
AVOptionRange
*
range
=
av_mallocz
(
sizeof
(
*
range
));
AVOptionRange
*
range
=
av_mallocz
(
sizeof
(
*
range
));
...
@@ -1229,7 +1231,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
...
@@ -1229,7 +1231,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
*
ranges_arg
=
NULL
;
*
ranges_arg
=
NULL
;
if
(
!
ranges
||
!
range
||
!
range_array
||
!
field
)
if
(
!
ranges
||
!
range
||
!
range_array
||
!
field
)
goto
fail
;
goto
fail
;
ranges
->
range
=
range_array
;
ranges
->
range
=
range_array
;
...
@@ -1239,7 +1241,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
...
@@ -1239,7 +1241,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
range
->
value_min
=
field
->
min
;
range
->
value_min
=
field
->
min
;
range
->
value_max
=
field
->
max
;
range
->
value_max
=
field
->
max
;
switch
(
field
->
type
)
{
switch
(
field
->
type
)
{
case
AV_OPT_TYPE_INT
:
case
AV_OPT_TYPE_INT
:
case
AV_OPT_TYPE_INT64
:
case
AV_OPT_TYPE_INT64
:
case
AV_OPT_TYPE_PIXEL_FMT
:
case
AV_OPT_TYPE_PIXEL_FMT
:
...
@@ -1275,11 +1277,12 @@ fail:
...
@@ -1275,11 +1277,12 @@ fail:
return
-
1
;
return
-
1
;
}
}
void
av_opt_freep_ranges
(
AVOptionRanges
**
rangesp
)
{
void
av_opt_freep_ranges
(
AVOptionRanges
**
rangesp
)
{
int
i
;
int
i
;
AVOptionRanges
*
ranges
=
*
rangesp
;
AVOptionRanges
*
ranges
=
*
rangesp
;
for
(
i
=
0
;
i
<
ranges
->
nb_ranges
;
i
++
)
{
for
(
i
=
0
;
i
<
ranges
->
nb_ranges
;
i
++
)
{
AVOptionRange
*
range
=
ranges
->
range
[
i
];
AVOptionRange
*
range
=
ranges
->
range
[
i
];
av_freep
(
&
range
->
str
);
av_freep
(
&
range
->
str
);
av_freep
(
&
ranges
->
range
[
i
]);
av_freep
(
&
ranges
->
range
[
i
]);
...
...
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