[farsight2/master] Dont hold the lock while calling add substream and remove the substream from the free list

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


---
 gst/fsrtpconference/fs-rtp-session.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 7848f33..6f221f7 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -2146,7 +2146,8 @@ fs_rtp_session_associate_ssrc_cname (FsRtpSession *session,
     fs_session_emit_error (FS_SESSION (session),FS_ERROR_UNKNOWN_CNAME,
         str, str);
     g_free (str);
-    goto done;
+    FS_RTP_SESSION_UNLOCK (session);
+    return;
   }
 
   for (item = g_list_first (session->priv->free_substreams);
@@ -2159,19 +2160,20 @@ fs_rtp_session_associate_ssrc_cname (FsRtpSession *session,
     g_object_get (localsubstream, "ssrc", &localssrc, NULL);
     if (ssrc == localssrc) {
       substream = localsubstream;
+      session->priv->free_substreams = g_list_delete_link (
+          session->priv->free_substreams, item);
       break;
     }
   }
+  FS_RTP_SESSION_UNLOCK (session);
 
   if (!substream)
-    goto done;
+    return;
+
 
   if (!fs_rtp_stream_add_substream (stream, substream, &error))
     fs_session_emit_error (FS_SESSION (session), error->code,
         "Could not associate a substream with its stream",
         error->message);
   g_clear_error (&error);
-
- done:
-  FS_RTP_SESSION_UNLOCK (session);
 }
-- 
1.5.6.5




More information about the farsight-commits mailing list