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
40665d27
Commit
40665d27
authored
Nov 23, 2014
by
Uwe L. Korn
Committed by
Martin Storsjö
Nov 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flvdec: Document how the duration is retrieved at the end of the file
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
fe42f94c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
flvdec.c
libavformat/flvdec.c
+4
-0
No files found.
libavformat/flvdec.c
View file @
40665d27
...
...
@@ -845,9 +845,13 @@ skip:
if
(
s
->
pb
->
seekable
&&
(
!
s
->
duration
||
s
->
duration
==
AV_NOPTS_VALUE
))
{
int
size
;
const
int64_t
pos
=
avio_tell
(
s
->
pb
);
// Read the last 4 bytes of the file, this should be the size of the
// previous FLV tag. Use the timestamp of its payload as duration.
const
int64_t
fsize
=
avio_size
(
s
->
pb
);
avio_seek
(
s
->
pb
,
fsize
-
4
,
SEEK_SET
);
size
=
avio_rb32
(
s
->
pb
);
// Seek to the start of the last FLV tag at position (fsize - 4 - size)
// but skip the byte indicating the type.
avio_seek
(
s
->
pb
,
fsize
-
3
-
size
,
SEEK_SET
);
if
(
size
==
avio_rb24
(
s
->
pb
)
+
11
)
{
uint32_t
ts
=
avio_rb24
(
s
->
pb
);
...
...
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