summaryrefslogtreecommitdiff
path: root/gst/rtpmanager/rtpsession.c
diff options
context:
space:
mode:
authorMiguel París Díaz <mparisdiaz@gmail.com>2016-05-05 14:18:21 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-05-06 09:24:22 +0300
commit2e960e70750a0cb7e1117d0c09d08597866a29ee (patch)
treeaa10c78f6282d3648ffe559e1d4c517c23247204 /gst/rtpmanager/rtpsession.c
parentc70ed4c914d7e1896c467873edeb7309541dff66 (diff)
rtpsession: Take session lock when creating stats
The access to the session hash table must happen while the session lock is taken, otherwise another thread might modify the hash table while we're creating the stats. https://bugzilla.gnome.org/show_bug.cgi?id=766025
Diffstat (limited to 'gst/rtpmanager/rtpsession.c')
-rw-r--r--gst/rtpmanager/rtpsession.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index 3c26e3467..e530c95b8 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -749,10 +749,12 @@ rtp_session_create_stats (RTPSession * sess)
"sent-nack-count", G_TYPE_UINT, sess->stats.nacks_sent,
"recv-nack-count", G_TYPE_UINT, sess->stats.nacks_received, NULL);
+ RTP_SESSION_LOCK (sess);
size = g_hash_table_size (sess->ssrcs[sess->mask_idx]);
source_stats = g_value_array_new (size);
g_hash_table_foreach (sess->ssrcs[sess->mask_idx],
(GHFunc) create_source_stats, source_stats);
+ RTP_SESSION_UNLOCK (sess);
g_value_init (&source_stats_v, G_TYPE_VALUE_ARRAY);
g_value_take_boxed (&source_stats_v, source_stats);