From 484306ea21db9086d860e3e21ec7b41174c9cf15 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Fri, 21 Apr 2017 10:01:15 +0200 Subject: rtp: test the session conference property before using it This may happen when the rtp session object is calling its dispose function in another thread. The disposed flag is set, and it prevents the fs_rtp_session_get_property() function to return its conference object. https://bugs.freedesktop.org/show_bug.cgi?id=101169 --- gst/fsrtpconference/fs-rtp-stream.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c index b2d59f2c..1ef6b2e8 100644 --- a/gst/fsrtpconference/fs-rtp-stream.c +++ b/gst/fsrtpconference/fs-rtp-stream.c @@ -826,6 +826,11 @@ _local_candidates_prepared (FsStreamTransmitter *stream_transmitter, g_object_get (session, "conference", &conf, NULL); + if (!conf) { + g_object_unref (session); + return; + } + gst_element_post_message (conf, gst_message_new_element (GST_OBJECT (conf), gst_structure_new ("farstream-local-candidates-prepared", @@ -853,6 +858,11 @@ _new_active_candidate_pair ( g_object_get (session, "conference", &conf, NULL); + if (!conf) { + g_object_unref (session); + return; + } + gst_element_post_message (conf, gst_message_new_element (GST_OBJECT (conf), gst_structure_new ("farstream-new-active-candidate-pair", @@ -881,6 +891,11 @@ _new_local_candidate ( g_object_get (session, "conference", &conf, NULL); + if (!conf) { + g_object_unref (session); + return; + } + gst_element_post_message (conf, gst_message_new_element (GST_OBJECT (conf), gst_structure_new ("farstream-new-local-candidate", @@ -929,6 +944,11 @@ _state_changed (FsStreamTransmitter *stream_transmitter, g_object_get (session, "conference", &conf, NULL); + if (!conf) { + g_object_unref (session); + return; + } + gst_element_post_message (conf, gst_message_new_element (GST_OBJECT (conf), gst_structure_new ("farstream-component-state-changed", -- cgit v1.2.1