summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/preview.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index c598c123a..20de012c0 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -214,7 +214,11 @@ caps_set(GstCaps *caps, preview_t *preview)
gst_video_calculate_display_ratio(
&num, &den, width, height, par_n, par_d, disp_par_n, disp_par_d);
- width = gst_util_uint64_scale_int(height, num, den);
+ if (par_n > par_d)
+ width = gst_util_uint64_scale_int(height, num, den);
+ else
+ height = gst_util_uint64_scale_int(width, den, num);
+
if (width != preview->width || height != preview->height)
{
gtk_widget_set_size_request(preview->view, width, height);