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
173d51c9
Commit
173d51c9
authored
Nov 11, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/opt: fix av_opt_get function
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
5aed6f56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
opt.c
libavutil/opt.c
+8
-2
No files found.
libavutil/opt.c
View file @
173d51c9
...
...
@@ -714,6 +714,10 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
return
AVERROR
(
EINVAL
);
if
(
!
(
*
out_val
=
av_malloc
(
len
*
2
+
1
)))
return
AVERROR
(
ENOMEM
);
if
(
!
len
)
{
*
out_val
[
0
]
=
'\0'
;
return
0
;
}
bin
=
*
(
uint8_t
**
)
dst
;
for
(
i
=
0
;
i
<
len
;
i
++
)
snprintf
(
*
out_val
+
i
*
2
,
3
,
"%02X"
,
bin
[
i
]);
...
...
@@ -729,12 +733,14 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
break
;
case
AV_OPT_TYPE_DURATION
:
i64
=
*
(
int64_t
*
)
dst
;
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"%"
PRIi64
"
d
:%02d:%02d.%06d"
,
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"%"
PRIi64
":%02d:%02d.%06d"
,
i64
/
3600000000
,
(
int
)((
i64
/
60000000
)
%
60
),
(
int
)((
i64
/
1000000
)
%
60
),
(
int
)(
i64
%
1000000
));
break
;
case
AV_OPT_TYPE_COLOR
:
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"0x%02x%02x%02x%02x"
,
((
int
*
)
dst
)[
0
],
((
int
*
)
dst
)[
1
],
((
int
*
)
dst
)[
2
],
((
int
*
)
dst
)[
3
]);
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"0x%02x%02x%02x%02x"
,
(
int
)((
uint8_t
*
)
dst
)[
0
],
(
int
)((
uint8_t
*
)
dst
)[
1
],
(
int
)((
uint8_t
*
)
dst
)[
2
],
(
int
)((
uint8_t
*
)
dst
)[
3
]);
break
;
case
AV_OPT_TYPE_CHANNEL_LAYOUT
:
i64
=
*
(
int64_t
*
)
dst
;
...
...
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