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.
This commit is contained in:
parent
0fca02bb5e
commit
27b28f3aec
@ -4017,6 +4017,9 @@ gst_webrtc_bin_finalize (GObject * object)
|
|||||||
gst_structure_free (webrtc->priv->stats);
|
gst_structure_free (webrtc->priv->stats);
|
||||||
webrtc->priv->stats = NULL;
|
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);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4334,6 +4337,8 @@ static void
|
|||||||
gst_webrtc_bin_init (GstWebRTCBin * webrtc)
|
gst_webrtc_bin_init (GstWebRTCBin * webrtc)
|
||||||
{
|
{
|
||||||
webrtc->priv = gst_webrtc_bin_get_instance_private (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);
|
_start_thread (webrtc);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user