Skip to content

Commit

Permalink
Insert private ID mapping only when participant is added to the list (f…
Browse files Browse the repository at this point in the history
…ixes #2781)
  • Loading branch information
lminiero committed Sep 29, 2021
1 parent e316c83 commit ec6e1d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -6202,7 +6202,6 @@ static void *janus_videoroom_handler(void *data) {
publisher->pvt_id = 0;
}
}
g_hash_table_insert(publisher->room->private_ids, GUINT_TO_POINTER(publisher->pvt_id), publisher);
g_atomic_int_set(&publisher->destroyed, 0);
janus_refcount_init(&publisher->ref, janus_videoroom_publisher_free);
/* In case we also wanted to configure */
Expand Down Expand Up @@ -6315,6 +6314,7 @@ static void *janus_videoroom_handler(void *data) {
g_hash_table_insert(publisher->room->participants,
string_ids ? (gpointer)g_strdup(publisher->user_id_str) : (gpointer)janus_uint64_dup(publisher->user_id),
publisher);
g_hash_table_insert(publisher->room->private_ids, GUINT_TO_POINTER(publisher->pvt_id), publisher);
janus_mutex_unlock(&session->mutex);
g_hash_table_iter_init(&iter, publisher->room->participants);
while (!g_atomic_int_get(&publisher->room->destroyed) && g_hash_table_iter_next(&iter, NULL, &value)) {
Expand Down

0 comments on commit ec6e1d4

Please sign in to comment.