summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager/rtpsession.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-07-27 12:43:02 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-07-27 12:43:02 +0200
commit7bd35cb8c77523000a7b4acdb58fe6fe6d88bbac (patch)
treeccd292878bddb4b2a05163b60c272777d9458bb0 /gst/rtpmanager/rtpsession.c
parenta20d86f1f525f79779727972925283910dc4173d (diff)
downloadgst-plugins-bad-7bd35cb8c77523000a7b4acdb58fe6fe6d88bbac.tar.gz
gst-plugins-bad-7bd35cb8c77523000a7b4acdb58fe6fe6d88bbac.tar.bz2
gst-plugins-bad-7bd35cb8c77523000a7b4acdb58fe6fe6d88bbac.zip
rtpbin: only reconsider once for BYE
When iterating the sources of a BYE packet, don't signal a reconsideration for each of them but signal after we handled all sources.
Diffstat (limited to 'gst/rtpmanager/rtpsession.c')
-rw-r--r--gst/rtpmanager/rtpsession.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index d63d9d0e..fe38c36a 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -1711,6 +1711,7 @@ rtp_session_process_bye (RTPSession * sess, GstRTCPPacket * packet,
{
guint count, i;
gchar *reason;
+ gboolean reconsider = FALSE;
reason = gst_rtcp_packet_bye_get_reason (packet);
GST_DEBUG ("got BYE packet (reason: %s)", GST_STR_NULL (reason));
@@ -1769,11 +1770,9 @@ rtp_session_process_bye (RTPSession * sess, GstRTCPPacket * packet,
sess->next_rtcp_check_time += arrival->time;
- RTP_SESSION_UNLOCK (sess);
- /* notify app of reconsideration */
- if (sess->callbacks.reconsider)
- sess->callbacks.reconsider (sess, sess->reconsider_user_data);
- RTP_SESSION_LOCK (sess);
+ /* mark pending reconsider. We only want to signal the reconsideration
+ * once after we handled all the source in the bye packet */
+ reconsider = TRUE;
}
}
@@ -1784,6 +1783,13 @@ rtp_session_process_bye (RTPSession * sess, GstRTCPPacket * packet,
g_object_unref (source);
}
+ if (reconsider) {
+ RTP_SESSION_UNLOCK (sess);
+ /* notify app of reconsideration */
+ if (sess->callbacks.reconsider)
+ sess->callbacks.reconsider (sess, sess->reconsider_user_data);
+ RTP_SESSION_LOCK (sess);
+ }
g_free (reason);
}