rtpsession: lock session when changing bandwidth
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 23 Jul 2013 15:38:20 +0000 (17:38 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 23 Jul 2013 15:41:48 +0000 (17:41 +0200)
Take the session lock when changing the bandwidth properties so that we don't
end up with inconsistent behaviour.

gst/rtpmanager/rtpsession.c

index 04b2901..c7ef33d 100644 (file)
@@ -590,20 +590,28 @@ rtp_session_set_property (GObject * object, guint prop_id,
       rtp_session_set_internal_ssrc (sess, g_value_get_uint (value));
       break;
     case PROP_BANDWIDTH:
+      RTP_SESSION_LOCK (sess);
       sess->bandwidth = g_value_get_double (value);
       sess->recalc_bandwidth = TRUE;
+      RTP_SESSION_UNLOCK (sess);
       break;
     case PROP_RTCP_FRACTION:
+      RTP_SESSION_LOCK (sess);
       sess->rtcp_bandwidth = g_value_get_double (value);
       sess->recalc_bandwidth = TRUE;
+      RTP_SESSION_UNLOCK (sess);
       break;
     case PROP_RTCP_RR_BANDWIDTH:
+      RTP_SESSION_LOCK (sess);
       sess->rtcp_rr_bandwidth = g_value_get_int (value);
       sess->recalc_bandwidth = TRUE;
+      RTP_SESSION_UNLOCK (sess);
       break;
     case PROP_RTCP_RS_BANDWIDTH:
+      RTP_SESSION_LOCK (sess);
       sess->rtcp_rs_bandwidth = g_value_get_int (value);
       sess->recalc_bandwidth = TRUE;
+      RTP_SESSION_UNLOCK (sess);
       break;
     case PROP_RTCP_MTU:
       sess->mtu = g_value_get_uint (value);