[vlc-commits] RTP: skip reordering timer in case of TCP

Rémi Denis-Courmont git at videolan.org
Tue Mar 1 22:32:34 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Mar  1 23:32:10 2011 +0200| [94f9d6e0d3e069a91df8cfb532ce5dbb7c473a96] | committer: Rémi Denis-Courmont

RTP: skip reordering timer in case of TCP

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=94f9d6e0d3e069a91df8cfb532ce5dbb7c473a96
---

 modules/access/rtp/input.c   |    2 +-
 modules/access/rtp/rtp.h     |    1 +
 modules/access/rtp/session.c |   15 +++++++++++++++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index 7322528..ca67b6d 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -163,7 +163,6 @@ void *rtp_stream_thread (void *opaque)
     for (;;)
     {
         /* There is no reordering on stream sockets, so no timeout. */
-        /* FIXME: hack rtp_dequeue() to skip the reordering/timer */
         ssize_t val;
 
         uint16_t frame_len;
@@ -186,6 +185,7 @@ void *rtp_stream_thread (void *opaque)
 
         int canc = vlc_savecancel ();
         rtp_process (demux, block);
+        rtp_dequeue_force (demux, sys->session);
         vlc_restorecancel (canc);
     }
 #else
diff --git a/modules/access/rtp/rtp.h b/modules/access/rtp/rtp.h
index 63fa5bb..42e3c5f 100644
--- a/modules/access/rtp/rtp.h
+++ b/modules/access/rtp/rtp.h
@@ -52,6 +52,7 @@ rtp_session_t *rtp_session_create (demux_t *);
 void rtp_session_destroy (demux_t *, rtp_session_t *);
 void rtp_queue (demux_t *, rtp_session_t *, block_t *);
 bool rtp_dequeue (demux_t *, const rtp_session_t *, mtime_t *);
+void rtp_dequeue_force (demux_t *, const rtp_session_t *);
 int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt);
 
 void *rtp_dgram_thread (void *data);
diff --git a/modules/access/rtp/session.c b/modules/access/rtp/session.c
index 7fb52dc..8fc6d5f 100644
--- a/modules/access/rtp/session.c
+++ b/modules/access/rtp/session.c
@@ -461,6 +461,21 @@ bool rtp_dequeue (demux_t *demux, const rtp_session_t *session,
     return pending;
 }
 
+/**
+ * Dequeues all RTP packets and pass them to decoder. Not cancellation-safe(?).
+ * This function can be used when the packet source is known not to reorder.
+ */
+void rtp_dequeue_force (demux_t *demux, const rtp_session_t *session)
+{
+    for (unsigned i = 0, max = session->srcc; i < max; i++)
+    {
+        rtp_source_t *src = session->srcv[i];
+        block_t *block;
+
+        while (((block = src->blocks)) != NULL)
+            rtp_decode (demux, session, src);
+    }
+}
 
 /**
  * Decodes one RTP packet.



More information about the vlc-commits mailing list