summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager/rtpsession.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-07-27 13:17:20 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-07-27 13:17:20 +0200
commit9b1bdac9cc60e274ddc10b2948d9f7d70f2b6e49 (patch)
tree2f8103961be8045d63d23d6771a3ac12608e059b /gst/rtpmanager/rtpsession.c
parent7bd35cb8c77523000a7b4acdb58fe6fe6d88bbac (diff)
downloadgst-plugins-bad-9b1bdac9cc60e274ddc10b2948d9f7d70f2b6e49.tar.gz
gst-plugins-bad-9b1bdac9cc60e274ddc10b2948d9f7d70f2b6e49.tar.bz2
gst-plugins-bad-9b1bdac9cc60e274ddc10b2948d9f7d70f2b6e49.zip
rtpbin: don't do lip-sync after a BYE
After a BYE packet from a source, stop forwarding the SR packets for lip-sync to rtpbin. Some senders don't update their SR packets correctly after sending a BYE and then we break lip-sync. We prefer to let the jitterbuffers drain with the current lip-sync instead.
Diffstat (limited to 'gst/rtpmanager/rtpsession.c')
-rw-r--r--gst/rtpmanager/rtpsession.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index fe38c36a..9d73d51d 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -1577,7 +1577,7 @@ rtp_session_process_rb (RTPSession * sess, RTPSource * source,
*/
static void
rtp_session_process_sr (RTPSession * sess, GstRTCPPacket * packet,
- RTPArrivalStats * arrival)
+ RTPArrivalStats * arrival, gboolean * do_sync)
{
guint32 senderssrc, rtptime, packet_count, octet_count;
guint64 ntptime;
@@ -1594,6 +1594,12 @@ rtp_session_process_sr (RTPSession * sess, GstRTCPPacket * packet,
if (!source)
return;
+ /* don't try to do lip-sync for sources that sent a BYE */
+ if (rtp_source_received_bye (source))
+ *do_sync = FALSE;
+ else
+ *do_sync = TRUE;
+
prevsender = RTP_SOURCE_IS_SENDER (source);
/* first update the source */
@@ -1816,7 +1822,7 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer,
GstClockTime current_time)
{
GstRTCPPacket packet;
- gboolean more, is_bye = FALSE, is_sr = FALSE;
+ gboolean more, is_bye = FALSE, do_sync = FALSE;
RTPArrivalStats arrival;
GstFlowReturn result = GST_FLOW_OK;
@@ -1853,8 +1859,7 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer,
switch (type) {
case GST_RTCP_TYPE_SR:
- rtp_session_process_sr (sess, &packet, &arrival);
- is_sr = TRUE;
+ rtp_session_process_sr (sess, &packet, &arrival, &do_sync);
break;
case GST_RTCP_TYPE_RR:
rtp_session_process_rr (sess, &packet, &arrival);
@@ -1891,7 +1896,7 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer,
RTP_SESSION_UNLOCK (sess);
/* notify caller of sr packets in the callback */
- if (is_sr && sess->callbacks.sync_rtcp)
+ if (do_sync && sess->callbacks.sync_rtcp)
result = sess->callbacks.sync_rtcp (sess, sess->source, buffer,
sess->sync_rtcp_user_data);
else