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
9648c4fe
Commit
9648c4fe
authored
Dec 07, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/opt: factor set_string_image_size() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7f763775
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
opt.c
libavutil/opt.c
+16
-9
No files found.
libavutil/opt.c
View file @
9648c4fe
...
...
@@ -252,6 +252,21 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con
return
0
;
}
static
int
set_string_image_size
(
void
*
obj
,
const
AVOption
*
o
,
const
char
*
val
,
int
*
dst
)
{
int
ret
;
if
(
!
val
||
!
strcmp
(
val
,
"none"
))
{
dst
[
0
]
=
dst
[
1
]
=
0
;
return
0
;
}
ret
=
av_parse_video_size
(
dst
,
dst
+
1
,
val
);
if
(
ret
<
0
)
av_log
(
obj
,
AV_LOG_ERROR
,
"Unable to parse option value
\"
%s
\"
as image size
\n
"
,
val
);
return
ret
;
}
#if FF_API_OLD_AVOPTIONS
int
av_set_string3
(
void
*
obj
,
const
char
*
name
,
const
char
*
val
,
int
alloc
,
const
AVOption
**
o_out
)
{
...
...
@@ -286,15 +301,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
case
AV_OPT_TYPE_FLOAT
:
case
AV_OPT_TYPE_DOUBLE
:
case
AV_OPT_TYPE_RATIONAL
:
return
set_string_number
(
obj
,
target_obj
,
o
,
val
,
dst
);
case
AV_OPT_TYPE_IMAGE_SIZE
:
if
(
!
val
||
!
strcmp
(
val
,
"none"
))
{
*
(
int
*
)
dst
=
*
((
int
*
)
dst
+
1
)
=
0
;
return
0
;
}
ret
=
av_parse_video_size
(
dst
,
((
int
*
)
dst
)
+
1
,
val
);
if
(
ret
<
0
)
av_log
(
obj
,
AV_LOG_ERROR
,
"Unable to parse option value
\"
%s
\"
as image size
\n
"
,
val
);
return
ret
;
case
AV_OPT_TYPE_IMAGE_SIZE
:
return
set_string_image_size
(
obj
,
o
,
val
,
dst
);
case
AV_OPT_TYPE_VIDEO_RATE
:
if
(
!
val
)
{
ret
=
AVERROR
(
EINVAL
);
...
...
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