]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10225: [mod_conference] Incorrect layout chosen when playing a file in a conferenc...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 13 Apr 2017 18:41:31 +0000 (13:41 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 13 Apr 2017 18:44:38 +0000 (13:44 -0500)
src/mod/applications/mod_conference/conference_video.c

index e9a8d5407cc1e35f2b0699f754d26f0ac5b86c86..7f217b7d9838d57ff0d5c6a54e8aaf3d46e7b454 100644 (file)
@@ -2377,17 +2377,15 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                        int no_muted = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS);
                        int no_av = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS);
                        int seen = conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN);
-                       
-                       if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) && 
-                               !conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
+
+                       if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
+                               !conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) && imember->video_layer_id > -1 && 
                                conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || (no_av && !imember->avatar_png_img))
                                && imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY && imember->video_media_flow != SWITCH_MEDIA_FLOW_INACTIVE) {
                                video_count++;
                        }
-                       
                }
 
-
                if (video_count != canvas->video_count || video_count != last_video_count) {
                        count_changed = 1;
                }
@@ -2440,7 +2438,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                        video_layout_t *vlayout = NULL;
                        
                        if (canvas->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, canvas->video_layout_group))) {
-                               if ((vlayout = conference_video_find_best_layout(conference, lg, canvas->video_count, file_count)) && vlayout != canvas->vlayout) {
+                               if ((vlayout = conference_video_find_best_layout(conference, lg, canvas->video_count - file_count, file_count)) && vlayout != canvas->vlayout) {
                                        switch_mutex_lock(conference->member_mutex);
                                        canvas->new_vlayout = vlayout;
                                        switch_mutex_unlock(conference->member_mutex);