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
dd5f9259
Commit
dd5f9259
authored
Dec 04, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/utils: Fix pts_wrap_behavior calculation with negative first_dts
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
704cc5e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
utils.c
libavformat/utils.c
+4
-3
No files found.
libavformat/utils.c
View file @
dd5f9259
...
...
@@ -874,11 +874,12 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
st
->
pts_wrap_reference
==
AV_NOPTS_VALUE
&&
st
->
first_dts
!=
AV_NOPTS_VALUE
)
{
int
i
;
int64_t
ref
=
st
->
first_dts
&
((
1LL
<<
st
->
pts_wrap_bits
)
-
1
);
// reference time stamp should be 60 s before first time stamp
int64_t
pts_wrap_reference
=
st
->
first_dts
-
av_rescale
(
60
,
st
->
time_base
.
den
,
st
->
time_base
.
num
);
int64_t
pts_wrap_reference
=
ref
-
av_rescale
(
60
,
st
->
time_base
.
den
,
st
->
time_base
.
num
);
// if first time stamp is not more than 1/8 and 60s before the wrap point, subtract rather than add wrap offset
int
pts_wrap_behavior
=
(
st
->
first_dts
<
(
1LL
<<
st
->
pts_wrap_bits
)
-
(
1LL
<<
st
->
pts_wrap_bits
-
3
))
||
(
st
->
first_dts
<
(
1LL
<<
st
->
pts_wrap_bits
)
-
av_rescale
(
60
,
st
->
time_base
.
den
,
st
->
time_base
.
num
))
?
int
pts_wrap_behavior
=
(
ref
<
(
1LL
<<
st
->
pts_wrap_bits
)
-
(
1LL
<<
st
->
pts_wrap_bits
-
3
))
||
(
ref
<
(
1LL
<<
st
->
pts_wrap_bits
)
-
av_rescale
(
60
,
st
->
time_base
.
den
,
st
->
time_base
.
num
))
?
AV_PTS_WRAP_ADD_OFFSET
:
AV_PTS_WRAP_SUB_OFFSET
;
AVProgram
*
first_program
=
av_find_program_from_stream
(
s
,
NULL
,
stream_index
);
...
...
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