diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/compositor/compositor.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c index 942c48036..dd1ba7071 100644 --- a/gst/compositor/compositor.c +++ b/gst/compositor/compositor.c @@ -221,7 +221,7 @@ _mixer_pad_get_output_size (GstCompositor * comp, GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (comp); GstVideoAggregatorPad *vagg_pad = GST_VIDEO_AGGREGATOR_PAD (comp_pad); gint pad_width, pad_height; - gint dar_n, dar_d; + guint dar_n, dar_d; pad_width = comp_pad->width <= @@ -230,21 +230,22 @@ _mixer_pad_get_output_size (GstCompositor * comp, comp_pad->height <= 0 ? GST_VIDEO_INFO_HEIGHT (&vagg_pad->info) : comp_pad->height; - gst_util_fraction_multiply (GST_VIDEO_INFO_PAR_N (&vagg_pad->info), + gst_video_calculate_display_ratio (&dar_n, &dar_d, pad_width, pad_height, + GST_VIDEO_INFO_PAR_N (&vagg_pad->info), GST_VIDEO_INFO_PAR_D (&vagg_pad->info), - GST_VIDEO_INFO_PAR_D (&vagg->info), GST_VIDEO_INFO_PAR_N (&vagg->info), - &dar_n, &dar_d); + GST_VIDEO_INFO_PAR_N (&vagg->info), GST_VIDEO_INFO_PAR_D (&vagg->info) + ); GST_LOG_OBJECT (comp_pad, "scaling %ux%u by %u/%u (%u/%u / %u/%u)", pad_width, pad_height, dar_n, dar_d, GST_VIDEO_INFO_PAR_N (&vagg_pad->info), GST_VIDEO_INFO_PAR_D (&vagg_pad->info), GST_VIDEO_INFO_PAR_N (&vagg->info), GST_VIDEO_INFO_PAR_D (&vagg->info)); if (pad_height % dar_n == 0) { - pad_height = gst_util_uint64_scale_int (pad_width, dar_n, dar_d); + pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d); } else if (pad_width % dar_d == 0) { - pad_width = gst_util_uint64_scale_int (pad_height, dar_d, dar_n); + pad_height = gst_util_uint64_scale_int (pad_width, dar_d, dar_n); } else { - pad_height = gst_util_uint64_scale_int (pad_width, dar_n, dar_d); + pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d); } if (width) |