[vlc-devel] commit: RTP: implement demux EOF ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Nov 27 18:13:41 CET 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Thu Nov 27 18:45:17 2008 +0200| [ab36d2f79979987e7ec4c20dd4a90882a0a705de] | committer: Rémi Denis-Courmont 

RTP: implement demux EOF

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

 modules/access/rtp/input.c |    8 +++++++-
 modules/access/rtp/rtp.c   |    3 +--
 modules/access/rtp/rtp.h   |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index 0cfa406..73b37b8 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -190,7 +190,11 @@ void *rtp_thread (void *data)
 }
 
 
-void rtp_process (demux_t *demux)
+/**
+ * Process one RTP packet from the de-jitter queue.
+ * @return 0 on success, -1 on EOF
+ */
+int rtp_process (demux_t *demux)
 {
     demux_sys_t *p_sys = demux->p_sys;
     mtime_t deadline = INT64_MAX;
@@ -202,4 +206,6 @@ void rtp_process (demux_t *demux)
     else
         vlc_cond_wait (&p_sys->wait, &p_sys->lock);
     vlc_mutex_unlock (&p_sys->lock);
+
+    return p_sys->dead ? -1 : 0;
 }
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index c3b4bd0..056d940 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -632,6 +632,5 @@ int rtp_autodetect (demux_t *demux, rtp_session_t *session,
  */
 static int Demux (demux_t *demux)
 {
-    rtp_process (demux);
-    return 1;
+    return rtp_process (demux) ? 0 : 1;
 }
diff --git a/modules/access/rtp/rtp.h b/modules/access/rtp/rtp.h
index 9861664..0d7659d 100644
--- a/modules/access/rtp/rtp.h
+++ b/modules/access/rtp/rtp.h
@@ -46,7 +46,7 @@ void rtp_queue (demux_t *, rtp_session_t *, block_t *);
 bool rtp_dequeue (demux_t *, const rtp_session_t *, mtime_t *);
 int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt);
 
-void rtp_process (demux_t *demux);
+int rtp_process (demux_t *demux);
 void *rtp_thread (void *data);
 
 /* Global data */




More information about the vlc-devel mailing list