]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10091: [mod_conference] Conference play file with full-screen=true has side effect...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 20 Jul 2017 22:25:08 +0000 (17:25 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 20 Jul 2017 22:25:08 +0000 (17:25 -0500)
src/mod/applications/mod_conference/conference_file.c
src/mod/applications/mod_conference/conference_video.c

index 8fe7bfa87246ad35495b51f478e33d1fb4e96b53..400a2c6ebfcdacefe066a0506970a59218f670b8 100644 (file)
@@ -94,8 +94,11 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
 
        if (conference->playing_video_file) {
                conference->canvases[node->canvas_id]->send_keyframe = 1;
+               conference->canvases[node->canvas_id]->play_file = 0;
                conference->playing_video_file = 0;
        }
+
+
        return switch_core_file_close(&node->fh);
 }
 
index 791cce38e732931f13401219fa6b838f6bfc4f6f..e4640b6cdbec555c37d46a75dc651b7186d36d54 100644 (file)
@@ -1949,7 +1949,9 @@ void conference_video_fnode_check(conference_file_node_t *fnode, int canvas_id)
                }
 
                if (full_screen) {
-                       canvas->play_file = 1;
+                       if (canvas->play_file == 0) {
+                               canvas->play_file = 1;
+                       }
                        canvas->conference->playing_video_file = 1;
                } else {
                        conference_video_canvas_set_fnode_layer(canvas, fnode, -1);
@@ -3244,17 +3246,23 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 
                        if (conference->playing_video_file) {
                                if (switch_core_file_read_video(&conference->fnode->fh, &write_frame, SVR_FLUSH) == SWITCH_STATUS_SUCCESS) {
-                                       switch_img_free(&file_img);
+                                       switch_image_t *tmp = NULL;
 
-                                       if (canvas->play_file) {
+                                       if (canvas->play_file == 1) {
                                                canvas->send_keyframe = 1;
-                                               canvas->play_file = 0;
+                                               canvas->play_file = -1;
                                        }
-
+                                       
                                        switch_img_free(&file_img);
-                                       switch_img_fit(&write_frame.img, canvas->img->d_w, canvas->img->d_h, SWITCH_FIT_SIZE);
-                                       file_img = write_img = write_frame.img;
 
+                                       switch_img_letterbox(write_frame.img, &tmp, canvas->img->d_w, canvas->img->d_h, "#000000");
+                                       if (tmp) {
+                                               switch_img_free(&write_frame.img);
+                                               file_img = write_img = write_frame.img = tmp;
+                                       } else {
+                                               file_img = write_img = write_frame.img;
+                                       }
+                                       
                                        //switch_core_timer_sync(&canvas->timer);
                                        timestamp = canvas->timer.samplecount;
                                } else if (file_img) {