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
b204c46d
Commit
b204c46d
authored
Oct 11, 2011
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flvdec: Split out setting of numeric fields from storing metadata
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
46c3c53b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
flvdec.c
libavformat/flvdec.c
+9
-5
No files found.
libavformat/flvdec.c
View file @
b204c46d
...
...
@@ -287,17 +287,21 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
acodec
=
astream
?
astream
->
codec
:
NULL
;
vcodec
=
vstream
?
vstream
->
codec
:
NULL
;
if
(
amf_type
==
AMF_DATA_TYPE_NUMBER
)
{
if
(
!
strcmp
(
key
,
"duration"
))
s
->
duration
=
num_val
*
AV_TIME_BASE
;
else
if
(
!
strcmp
(
key
,
"videodatarate"
)
&&
vcodec
&&
0
<=
(
int
)(
num_val
*
1024
.
0
))
vcodec
->
bit_rate
=
num_val
*
1024
.
0
;
else
if
(
!
strcmp
(
key
,
"audiodatarate"
)
&&
acodec
&&
0
<=
(
int
)(
num_val
*
1024
.
0
))
acodec
->
bit_rate
=
num_val
*
1024
.
0
;
}
if
(
amf_type
==
AMF_DATA_TYPE_BOOL
)
{
av_strlcpy
(
str_val
,
num_val
>
0
?
"true"
:
"false"
,
sizeof
(
str_val
));
av_dict_set
(
&
s
->
metadata
,
key
,
str_val
,
0
);
}
else
if
(
amf_type
==
AMF_DATA_TYPE_NUMBER
)
{
snprintf
(
str_val
,
sizeof
(
str_val
),
"%.f"
,
num_val
);
av_dict_set
(
&
s
->
metadata
,
key
,
str_val
,
0
);
if
(
!
strcmp
(
key
,
"duration"
))
s
->
duration
=
num_val
*
AV_TIME_BASE
;
else
if
(
!
strcmp
(
key
,
"videodatarate"
)
&&
vcodec
&&
0
<=
(
int
)(
num_val
*
1024
.
0
))
vcodec
->
bit_rate
=
num_val
*
1024
.
0
;
else
if
(
!
strcmp
(
key
,
"audiodatarate"
)
&&
acodec
&&
0
<=
(
int
)(
num_val
*
1024
.
0
))
acodec
->
bit_rate
=
num_val
*
1024
.
0
;
}
else
if
(
amf_type
==
AMF_DATA_TYPE_STRING
)
av_dict_set
(
&
s
->
metadata
,
key
,
str_val
,
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