Skip to content

Commit

Permalink
Moved comment on talking events
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed May 26, 2020
1 parent acd414c commit 212d46a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2519,10 +2519,6 @@ static void janus_videoroom_notify_participants(janus_videoroom_publisher *parti
g_hash_table_iter_init(&iter, participant->room->participants);
while (participant->room && !g_atomic_int_get(&participant->room->destroyed) && g_hash_table_iter_next(&iter, NULL, &value)) {
janus_videoroom_publisher *p = value;
/*
Normally, only participants which are not the source of the event are notified
Exception: To save cpu time one the client side, the speaking event is also sent to the speak
*/
if(p && p->session && (p != participant || notify_source_participant)) {
JANUS_LOG(LOG_VERB, "Notifying participant %s (%s)\n", p->user_id_str, p->display ? p->display : "??");
int ret = gateway->push_event(p->session->handle, &janus_videoroom_plugin, NULL, msg, NULL);
Expand Down Expand Up @@ -4875,6 +4871,7 @@ void janus_videoroom_incoming_rtp(janus_plugin_session *handle, janus_plugin_rtp
json_object_set_new(event, "room", string_ids ? json_string(videoroom->room_id_str) : json_integer(videoroom->room_id));
json_object_set_new(event, "id", string_ids ? json_string(participant->user_id_str) : json_integer(participant->user_id));
json_object_set_new(event, "audio-level-dBov-avg", json_real(audio_dBov_avg));
/* Notify the speaker this event is related to as well */
janus_videoroom_notify_participants(participant, event, TRUE);
json_decref(event);
janus_mutex_unlock(&videoroom->mutex);
Expand Down

0 comments on commit 212d46a

Please sign in to comment.