Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
b19614ae
Commit
b19614ae
authored
Feb 24, 2012
by
Sébastien Escudier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat : fix overflow in timestamp computation
parent
b7d96d26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
+31
-11
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+31
-11
No files found.
modules/demux/avformat/demux.c
View file @
b19614ae
...
...
@@ -609,17 +609,37 @@ static int Demux( demux_t *p_demux )
if
(
pkt
.
flags
&
AV_PKT_FLAG_KEY
)
p_frame
->
i_flags
|=
BLOCK_FLAG_TYPE_I
;
i_start_time
=
(
p_sys
->
ic
->
start_time
!=
(
int64_t
)
AV_NOPTS_VALUE
)
?
(
p_sys
->
ic
->
start_time
*
1000000
/
AV_TIME_BASE
)
:
0
;
p_frame
->
i_dts
=
(
pkt
.
dts
==
(
int64_t
)
AV_NOPTS_VALUE
)
?
VLC_TS_INVALID
:
(
pkt
.
dts
)
*
1000000
*
p_stream
->
time_base
.
num
/
p_stream
->
time_base
.
den
-
i_start_time
+
VLC_TS_0
;
p_frame
->
i_pts
=
(
pkt
.
pts
==
(
int64_t
)
AV_NOPTS_VALUE
)
?
VLC_TS_INVALID
:
(
pkt
.
pts
)
*
1000000
*
p_stream
->
time_base
.
num
/
p_stream
->
time_base
.
den
-
i_start_time
+
VLC_TS_0
;
/* Used to avoid timestamps overlow */
lldiv_t
q
;
if
(
p_sys
->
ic
->
start_time
!=
(
int64_t
)
AV_NOPTS_VALUE
)
{
q
=
lldiv
(
p_sys
->
ic
->
start_time
,
AV_TIME_BASE
);
i_start_time
=
q
.
quot
*
(
int64_t
)
1000000
+
q
.
rem
*
(
int64_t
)
1000000
/
AV_TIME_BASE
;
}
else
i_start_time
=
0
;
if
(
pkt
.
dts
==
(
int64_t
)
AV_NOPTS_VALUE
)
p_frame
->
i_dts
=
VLC_TS_INVALID
;
else
{
q
=
lldiv
(
pkt
.
dts
,
p_stream
->
time_base
.
den
);
p_frame
->
i_dts
=
q
.
quot
*
(
int64_t
)
1000000
*
p_stream
->
time_base
.
num
+
q
.
rem
*
(
int64_t
)
1000000
*
p_stream
->
time_base
.
num
/
p_stream
->
time_base
.
den
-
i_start_time
+
VLC_TS_0
;
}
if
(
pkt
.
pts
==
(
int64_t
)
AV_NOPTS_VALUE
)
p_frame
->
i_pts
=
VLC_TS_INVALID
;
else
{
q
=
lldiv
(
pkt
.
pts
,
p_stream
->
time_base
.
den
);
p_frame
->
i_pts
=
q
.
quot
*
(
int64_t
)
1000000
*
p_stream
->
time_base
.
num
+
q
.
rem
*
(
int64_t
)
1000000
*
p_stream
->
time_base
.
num
/
p_stream
->
time_base
.
den
-
i_start_time
+
VLC_TS_0
;
}
if
(
pkt
.
duration
>
0
&&
p_frame
->
i_length
<=
0
)
p_frame
->
i_length
=
pkt
.
duration
*
1000000
*
p_stream
->
time_base
.
num
/
...
...
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