[vlc-devel] commit: RTP: notify demux thread when RTP flow is dead ( 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:43:15 2008 +0200| [e03130e4d0c97aaf0cdced7ece6d3077bdcd01b9] | committer: Rémi Denis-Courmont
RTP: notify demux thread when RTP flow is dead
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e03130e4d0c97aaf0cdced7ece6d3077bdcd01b9
---
modules/access/rtp/input.c | 30 ++++++++++++++++--------------
modules/access/rtp/rtp.c | 1 +
modules/access/rtp/rtp.h | 11 ++++++-----
3 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index 995c7ba..dc1110b 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -160,30 +160,32 @@ void *rtp_thread (void *data)
demux_t *demux = data;
demux_sys_t *p_sys = demux->p_sys;
- for (;;)
+ do
{
block_t *block = rtp_recv (demux);
- if (block == NULL)
- break; /* fatal error: abort */
vlc_mutex_lock (&p_sys->lock);
-
- /* Autodetect payload type, _before_ rtp_queue() */
- if (p_sys->autodetect)
+ if (block == NULL)
+ p_sys->dead = true; /* Fatal error: abort */
+ else
{
- if (rtp_autodetect (demux, p_sys->session, block))
- {
- block_Release (block);
- continue;
+ if (p_sys->autodetect)
+ { /* Autodetect payload type, _before_ rtp_queue() */
+ if (rtp_autodetect (demux, p_sys->session, block))
+ {
+ vlc_mutex_unlock (&p_sys->lock);
+ block_Release (block);
+ continue;
+ }
+ p_sys->autodetect = false;
}
- p_sys->autodetect = false;
+ rtp_queue (demux, p_sys->session, block);
}
-
- rtp_queue (demux, p_sys->session, block);
vlc_cond_signal (&p_sys->wait);
vlc_mutex_unlock (&p_sys->lock);
}
- /* TODO: return 0 from Demux */
+ while (!p_sys->dead);
+
return NULL;
}
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 0fb398f..c3b4bd0 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -237,6 +237,7 @@ static int Open (vlc_object_t *obj)
p_sys->max_misorder = var_CreateGetInteger (obj, "rtp-max-misorder");
p_sys->autodetect = true;
p_sys->framed_rtp = (tp == IPPROTO_TCP);
+ p_sys->dead = false;
demux->pf_demux = Demux;
demux->pf_control = Control;
diff --git a/modules/access/rtp/rtp.h b/modules/access/rtp/rtp.h
index c27c289..9861664 100644
--- a/modules/access/rtp/rtp.h
+++ b/modules/access/rtp/rtp.h
@@ -63,10 +63,11 @@ struct demux_sys_t
unsigned caching;
unsigned timeout;
- uint8_t max_src;
- uint16_t max_dropout;
- uint16_t max_misorder;
- bool autodetect;
- bool framed_rtp;
+ uint16_t max_dropout; /**< Max packet forward misordering */
+ uint16_t max_misorder; /**< Max packet backward misordering */
+ uint8_t max_src; /**< Max simultaneous RTP sources */
+ bool autodetect; /**< Payload format autodetection */
+ bool framed_rtp; /**< Framed RTP packets over TCP */
+ bool dead; /**< End of stream */
};
More information about the vlc-devel
mailing list