[farsight2/master] Always emit the no-rtcp-timedout signal, but disconnect the handler when we dont want it anymore

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:21:45 PST 2008


---
 gst/fsrtpconference/fs-rtp-session.c   |   11 +++++++++++
 gst/fsrtpconference/fs-rtp-substream.c |    5 ++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 43b513e..4c7ae33 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -2613,6 +2613,8 @@ fs_rtp_session_associate_ssrc_cname (FsRtpSession *session,
 
   while (
       g_signal_handlers_disconnect_by_func(substream, "error", session) > 0) {}
+  while (
+      g_signal_handlers_disconnect_by_func(substream, "no-rtcp-timedout", session) > 0) {}
 
   if (!fs_rtp_stream_add_substream (stream, substream, &error))
     fs_session_emit_error (FS_SESSION (session), error->code,
@@ -2646,12 +2648,21 @@ _substream_no_rtcp_timedout_cb (FsRtpSubStream *substream,
     goto done;
   }
 
+  if (!g_list_find (session->priv->free_substreams, substream))
+  {
+    GST_WARNING ("Could not find substream %p in the list of free substreams",
+        substream);
+    goto done;
+  }
+
   session->priv->free_substreams =
     g_list_remove (session->priv->free_substreams,
         substream);
 
   while (
       g_signal_handlers_disconnect_by_func(substream, "error", session) > 0) {}
+  while (
+      g_signal_handlers_disconnect_by_func(substream, "no-rtcp-timedout", session) > 0) {}
 
   if (!fs_rtp_stream_add_substream (
           g_list_first (session->priv->streams)->data,
diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c
index 3524c4e..a430ef6 100644
--- a/gst/fsrtpconference/fs-rtp-substream.c
+++ b/gst/fsrtpconference/fs-rtp-substream.c
@@ -320,14 +320,13 @@ _no_rtcp_timeout (gpointer user_data)
 
   FS_RTP_SESSION_LOCK (self->priv->session);
 
-  if (!self->priv->stream)
-    g_signal_emit (self, signals[NO_RTCP_TIMEDOUT], 0);
-
   if (self->priv->no_rtcp_timeout_id)
     self->priv->no_rtcp_timeout_id = 0;
 
   FS_RTP_SESSION_UNLOCK (self->priv->session);
 
+  g_signal_emit (self, signals[NO_RTCP_TIMEDOUT], 0);
+
   return FALSE;
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list