Commit 2e960e70 authored by Miguel París Díaz's avatar Miguel París Díaz Committed by Sebastian Dröge

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
parent c70ed4c9
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment