Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
9d223efe
Commit
9d223efe
authored
Mar 28, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTP: fix timestamp wrap - fix #1645
parent
a638c16c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
modules/access/rtp/session.c
modules/access/rtp/session.c
+13
-3
No files found.
modules/access/rtp/session.c
View file @
9d223efe
...
...
@@ -141,6 +141,9 @@ struct rtp_source_t
mtime_t
last_rx
;
/* last received packet local timestamp */
uint32_t
last_ts
;
/* last received packet RTP timestamp */
uint32_t
ref_rtp
;
/* sender RTP timestamp reference */
mtime_t
ref_ntp
;
/* sender NTP timestamp reference */
uint16_t
bad_seq
;
/* tentatively next expected sequence for resync */
uint16_t
max_seq
;
/* next expected sequence */
...
...
@@ -164,6 +167,9 @@ rtp_source_create (demux_t *demux, const rtp_session_t *session,
source
->
ssrc
=
ssrc
;
source
->
jitter
=
0
;
source
->
ref_rtp
=
0
;
/* TODO: use 0, but VLC does not like negative PTS at the moment */
source
->
ref_ntp
=
UINT64_C
(
1
)
<<
62
;
source
->
max_seq
=
source
->
bad_seq
=
init_seq
;
source
->
last_seq
=
init_seq
-
1
;
source
->
blocks
=
NULL
;
...
...
@@ -408,10 +414,14 @@ rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
* DTS is unknown. Also, while the clock frequency depends on the payload
* format, a single source MUST only use payloads of a chosen frequency.
* Otherwise it would be impossible to compute consistent timestamps. */
/* FIXME: handle timestamp wrap properly */
/* TODO: inter-medias/sessions sync (using RTCP-SR) */
const
uint32_t
timestamp
=
rtp_timestamp
(
block
);
block
->
i_pts
=
CLOCK_FREQ
*
timestamp
/
pt
->
frequency
;
block
->
i_pts
=
src
->
ref_ntp
+
CLOCK_FREQ
*
(
int32_t
)(
timestamp
-
src
->
ref_rtp
)
/
pt
->
frequency
;
msg_Info
(
demux
,
"PTS = %lld, NTP = %lld, RTPd = %d"
,
block
->
i_pts
,
src
->
ref_ntp
,
timestamp
-
src
->
ref_rtp
);
/* TODO: proper inter-medias/sessions sync (using RTCP-SR) */
src
->
ref_ntp
=
block
->
i_pts
;
src
->
ref_rtp
=
timestamp
;
/* CSRC count */
size_t
skip
=
12u
+
(
block
->
p_buffer
[
0
]
&
0x0F
)
*
4
;
...
...
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