[vlc-devel] commit: RTP: set the discontinuity flag as appropriate ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Jun 8 17:39:22 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jun 8 17:52:16 2008 +0300| [3e3e4050ad254cdc5c1e60ca860ea71635a9d244]
RTP: set the discontinuity flag as appropriate
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e3e4050ad254cdc5c1e60ca860ea71635a9d244
---
modules/demux/rtpsession.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/modules/demux/rtpsession.c b/modules/demux/rtpsession.c
index 8339f26..62c24fd 100644
--- a/modules/demux/rtpsession.c
+++ b/modules/demux/rtpsession.c
@@ -141,6 +141,7 @@ struct rtp_source_t
uint16_t bad_seq; /* tentatively next expected sequence for resync */
uint16_t max_seq; /* next expected sequence */
+ uint16_t last_seq; /* sequence of the last dequeued packet */
block_t *blocks; /* re-ordered blocks queue */
void *opaque[0]; /* Per-source private payload data */
};
@@ -160,6 +161,7 @@ rtp_source_create (demux_t *demux, const rtp_session_t *session,
source->ssrc = ssrc;
source->max_seq = source->bad_seq = init_seq;
+ source->last_seq = init_seq - 1;
source->blocks = NULL;
/* Initializes all payload */
@@ -324,6 +326,11 @@ rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
src->blocks = block->p_next;
block->p_next = NULL;
+ /* Discontinuity detection */
+ if (((src->last_seq + 1) & 0xffff) != rtp_seq (block))
+ block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ src->last_seq = rtp_seq (block);
+
/* Match the payload type */
const rtp_pt_t *pt = NULL;
void *pt_data = NULL;
More information about the vlc-devel
mailing list