]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_conference] Fix memory consumption and Media flow direction issue. 1568/head
authorAndrey Volk <andywolk@gmail.com>
Mon, 7 Mar 2022 22:40:16 +0000 (01:40 +0300)
committerAndrey Volk <andywolk@gmail.com>
Mon, 7 Mar 2022 22:50:07 +0000 (01:50 +0300)
src/mod/applications/mod_conference/mod_conference.c
src/mod/applications/mod_conference/mod_conference.h

index ec1cd5c8f7f0ea80d1fb49ffeb9109e32e44d2d4..f512379cab61008548bebf67d8ad11aeb77396a9 100644 (file)
@@ -2479,9 +2479,13 @@ SWITCH_STANDARD_APP(conference_function)
        do {
                switch_media_flow_t audio_flow = switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_AUDIO);
                
-               if (switch_channel_test_flag(channel, CF_AUDIO) && (audio_flow == SWITCH_MEDIA_FLOW_SENDRECV || audio_flow == SWITCH_MEDIA_FLOW_RECVONLY)) {
+               if (switch_channel_test_flag(channel, CF_AUDIO) && (audio_flow == SWITCH_MEDIA_FLOW_SENDRECV || audio_flow == SWITCH_MEDIA_FLOW_SENDONLY)) {
                        conference_loop_output(&member);
                } else {
+                       if (!member.input_thread) {
+                               conference_loop_launch_input(&member, switch_core_session_get_pool(member.session));
+                       }
+
                        if (conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
                                switch_yield(100000);
                                member.loop_loop = 1;
index f6f932fc076577b7547f52e4c60db58961340fbf..3c28634264873eaa07cbbc8a45990db6f5b603bc 100644 (file)
@@ -1110,6 +1110,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
 void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thread, void *obj);
 void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_t *thread, void *obj);
 void conference_loop_output(conference_member_t *member);
+void conference_loop_launch_input(conference_member_t *member, switch_memory_pool_t *pool);
 uint32_t conference_file_stop(conference_obj_t *conference, file_stop_t stop);
 switch_status_t conference_file_play(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async);
 void conference_member_send_all_dtmf(conference_member_t *member, conference_obj_t *conference, const char *dtmf);