]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11363 Fix unpredictable/random zoom, when camera's video aspect ratio (a/r) equal...
authorshripchenko <shripchenko@intermedia.net>
Mon, 3 Sep 2018 15:20:15 +0000 (18:20 +0300)
committerMike Jerris <mike@jerris.com>
Wed, 5 Sep 2018 20:03:05 +0000 (20:03 +0000)
src/mod/applications/mod_conference/conference_video.c

index 4cb48cca18c038d0d6ec2756df502be7e3c922bb..af07a650c8f76b838797459df9967c17837bb3a5 100644 (file)
@@ -525,9 +525,9 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
 
                if (img->d_w && layer->last_w) {
                        if (img->d_w < layer->last_w) {
-                               change_scale = layer->last_w / img->d_w;
+                               change_scale = (double) layer->last_w / img->d_w;
                        } else {
-                               change_scale = img->d_w / layer->last_w;
+                               change_scale = (double) img->d_w / layer->last_w;
                        }
 
                        layer->crop_x = (int)(layer->crop_x * change_scale);
@@ -637,7 +637,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
                        int can_zoom = 0;
                        int did_zoom = 0;
 
-                       if (screen_aspect < img_aspect) {
+                       if (screen_aspect <= img_aspect) {
                                if (img->d_h != layer->screen_h) {
                                        scale = (double)layer->screen_h / img->d_h;
                                }
@@ -744,7 +744,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg,
                                        } else {
                                                crop_x = use_geometry->x;
                                        }
-                               } else if (screen_aspect < img_aspect) {
+                               } else if (screen_aspect <= img_aspect) {
                                        crop_x = img->w / 4;
                                }