]> 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:41:31 +0000 (13:41 -0500)
src/mod/applications/mod_conference/conference_video.c

index 7236785fef937ea1a879e5f0e910940056b1de83..6de8049067d80500caffc177342be46a6ba056b4 100644 (file)
@@ -2932,7 +2932,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                        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) &&
+                               !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++;
@@ -2940,7 +2940,6 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 
                }
 
-
                if (video_count != canvas->video_count || video_count != last_video_count) {
                        count_changed = 1;
                }
@@ -2996,7 +2995,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);