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 233cb99..87ad7bb 100644
--- a/ext/webrtc/gstwebrtcbin.c
+++ b/ext/webrtc/gstwebrtcbin.c
@@ -4016,6 +4016,9 @@
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);
}
@@ -4337,6 +4340,8 @@
webrtc->priv =
G_TYPE_INSTANCE_GET_PRIVATE ((webrtc), GST_TYPE_WEBRTC_BIN,
GstWebRTCBinPrivate);
+ g_mutex_init (PC_GET_LOCK (webrtc));
+ g_cond_init (PC_GET_COND (webrtc));
_start_thread (webrtc);