]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Revert "FS-11417: [mod_conference] Unbounded memory growth during screen share #resolve"
authorAndrey Volk <andywolk@gmail.com>
Fri, 28 Jun 2019 22:13:34 +0000 (02:13 +0400)
committerAndrey Volk <andywolk@gmail.com>
Fri, 28 Jun 2019 22:13:34 +0000 (02:13 +0400)
This reverts commit 143323e6ef466f51ed3aa3f1e6b7cd938ccba06e.

src/mod/applications/mod_conference/conference_loop.c
src/mod/applications/mod_conference/mod_conference.c

index 78024f10de4a2e44c52489528458dccae9f31625..49377312c647b409d3464d6e0ee11bad90291815 100644 (file)
@@ -939,10 +939,6 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
                        goto do_continue;
                }
 
-               if (!switch_channel_test_app_flag(channel, CF_AUDIO)) {
-                       goto do_continue;
-               }
-               
                /* if the member can speak, compute the audio energy level and */
                /* generate events when the level crosses the threshold        */
                if (((conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_HOLD)) ||
@@ -1232,7 +1228,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
 
                        if (datalen) {
                                switch_size_t ok = 1;
-                               
+
                                /* Write the audio into the input buffer */
                                switch_mutex_lock(member->audio_in_mutex);
                                if (switch_buffer_inuse(member->audio_buffer) > flush_len) {
index 86be4911a80d73fed5bd1261973a8a01f337e358..5562272309bfd3e20ec5cc09beb7cf27560cc8ce 100644 (file)
@@ -611,7 +611,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
                        for (omember = conference->members; omember; omember = omember->next) {
                                switch_size_t ok = 1;
 
-                               if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING) || !switch_channel_test_flag(omember->channel, CF_AUDIO)) {
+                               if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) {
                                        continue;
                                }
 
@@ -667,14 +667,13 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
                                        write_frame[x] = (int16_t) z;
                                }
 
-                               if (switch_channel_test_flag(omember->channel, CF_AUDIO)) {
-                                       switch_mutex_lock(omember->audio_out_mutex);
-                                       ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes);
-                                       switch_mutex_unlock(omember->audio_out_mutex);
-                                       if (!ok) {
-                                               switch_mutex_unlock(conference->mutex);
-                                               goto end;
-                                       }
+                               switch_mutex_lock(omember->audio_out_mutex);
+                               ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes);
+                               switch_mutex_unlock(omember->audio_out_mutex);
+
+                               if (!ok) {
+                                       switch_mutex_unlock(conference->mutex);
+                                       goto end;
                                }
                        }
                } else { /* There is no source audio.  Push silence into all of the buffers */
@@ -689,7 +688,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
                        for (omember = conference->members; omember; omember = omember->next) {
                                switch_size_t ok = 1;
 
-                               if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING) || !switch_channel_test_flag(omember->channel, CF_AUDIO)) {
+                               if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) {
                                        continue;
                                }