Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
71a5cd7d
Commit
71a5cd7d
authored
Aug 03, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flvdec: perform duration search just once
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a2232e69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
flvdec.c
libavformat/flvdec.c
+3
-1
No files found.
libavformat/flvdec.c
View file @
71a5cd7d
...
...
@@ -52,6 +52,7 @@ typedef struct {
}
validate_index
[
2
];
int
validate_next
;
int
validate_count
;
int
searched_for_end
;
}
FLVContext
;
static
int
flv_probe
(
AVProbeData
*
p
)
...
...
@@ -744,7 +745,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
}
// if not streamed and no duration from metadata then seek to end to find the duration from the timestamps
if
(
s
->
pb
->
seekable
&&
(
!
s
->
duration
||
s
->
duration
==
AV_NOPTS_VALUE
)){
if
(
s
->
pb
->
seekable
&&
(
!
s
->
duration
||
s
->
duration
==
AV_NOPTS_VALUE
)
&&
!
flv
->
searched_for_end
){
int
size
;
const
int64_t
pos
=
avio_tell
(
s
->
pb
);
const
int64_t
fsize
=
avio_size
(
s
->
pb
);
...
...
@@ -757,6 +758,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
s
->
duration
=
ts
*
(
int64_t
)
AV_TIME_BASE
/
1000
;
}
avio_seek
(
s
->
pb
,
pos
,
SEEK_SET
);
flv
->
searched_for_end
=
1
;
}
if
(
stream_type
==
FLV_STREAM_TYPE_AUDIO
){
...
...
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