[vlc-devel] commit: RTP: compute deadline for reordering from the current time ( Marian Ďurkovič )
git version control
git at videolan.org
Wed Sep 9 13:25:52 CEST 2009
vlc | branch: master | Marian Ďurkovič <md at bts.sk> | Wed Sep 9 13:25:09 2009 +0200| [2a605427ad0d2ec3ae942adf671519720c3b3fbe] | committer: Marian Ďurkovič
RTP: compute deadline for reordering from the current time
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a605427ad0d2ec3ae942adf671519720c3b3fbe
---
modules/access/rtp/session.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/access/rtp/session.c b/modules/access/rtp/session.c
index 7d1fef5..a281a5d 100644
--- a/modules/access/rtp/session.c
+++ b/modules/access/rtp/session.c
@@ -146,7 +146,7 @@ struct rtp_source_t
uint16_t last_seq; /* sequence of the next dequeued packet */
block_t *blocks; /* re-ordered blocks queue */
- mtime_t last_dq; /* last dequeued (decoded) packet local timestamp */
+ mtime_t ref_ts; /* reference timestamp for reordering */
void *opaque[0]; /* Per-source private payload data */
};
@@ -315,7 +315,6 @@ rtp_queue (demux_t *demux, rtp_session_t *session, block_t *block)
}
}
src->last_rx = now;
- block->i_pts = now;
src->last_ts = rtp_timestamp (block);
/* Check sequence number */
@@ -412,7 +411,7 @@ rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
/* FIXME: handle timestamp wrap properly */
/* TODO: inter-medias/sessions sync (using RTCP-SR) */
const uint32_t timestamp = rtp_timestamp (block);
- src->last_dq = block->i_pts;
+ src->ref_ts = 0;
block->i_pts = CLOCK_FREQ * timestamp / pt->frequency;
/* CSRC count */
@@ -492,8 +491,10 @@ bool rtp_dequeue (demux_t *demux, const rtp_session_t *session,
* match for random gaussian jitter). Additionnaly, we implicitly
* wait for misordering times the packetization time.
*/
- mtime_t deadline = src->last_dq;
+ mtime_t deadline = src->ref_ts;
const rtp_pt_t *pt = rtp_find_ptype (session, src, block, NULL);
+ if (!deadline)
+ deadline = src->ref_ts = now;
if (pt)
deadline += CLOCK_FREQ * 3 * src->jitter / pt->frequency;
More information about the vlc-devel
mailing list