mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 03:30:35 +00:00
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
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue