From: Jan Schmidt Date: Sun, 1 Jul 2018 00:44:45 +0000 (+1000) Subject: webrtc: Explicitly initialise mutex and condition X-Git-Tag: 1.19.3~507^2~4094 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27b28f3aec4c6bd9869c505bca5df5e7007a20b7;p=platform%2Fupstream%2Fgstreamer.git webrtc: Explicitly initialise mutex and condition Fixes random crashes when an allocated webrtcbin isn't given fresh 0-filled memory in its allocation. It works mostly because GMutex and GCond are automatically initialised in that case. --- diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index 95e6c96..5d00dfd 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -4017,6 +4017,9 @@ gst_webrtc_bin_finalize (GObject * object) gst_structure_free (webrtc->priv->stats); webrtc->priv->stats = NULL; + g_mutex_clear (PC_GET_LOCK (webrtc)); + g_cond_clear (PC_GET_COND (webrtc)); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -4334,6 +4337,8 @@ static void gst_webrtc_bin_init (GstWebRTCBin * webrtc) { webrtc->priv = gst_webrtc_bin_get_instance_private (webrtc); + g_mutex_init (PC_GET_LOCK (webrtc)); + g_cond_init (PC_GET_COND (webrtc)); _start_thread (webrtc);