mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
compositor: Check if we get a valid display ratio
As is done everywhere else, and avoids setting bogus values And remove useless *<val> checks (we always provide valid values and it's an internal function). CID #1320700
This commit is contained in:
parent
a76ad40c6c
commit
2d778881cb
1 changed files with 8 additions and 7 deletions
|
@ -239,9 +239,12 @@ _mixer_pad_get_output_size (GstCompositor * comp,
|
|||
comp_pad->height <=
|
||||
0 ? GST_VIDEO_INFO_HEIGHT (&vagg_pad->info) : comp_pad->height;
|
||||
|
||||
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), out_par_n, out_par_d);
|
||||
if (!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), out_par_n, out_par_d)) {
|
||||
GST_WARNING_OBJECT (comp_pad, "Cannot calculate display aspect ratio");
|
||||
*width = *height = 0;
|
||||
}
|
||||
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), out_par_n, out_par_d);
|
||||
|
@ -254,10 +257,8 @@ _mixer_pad_get_output_size (GstCompositor * comp,
|
|||
pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d);
|
||||
}
|
||||
|
||||
if (width)
|
||||
*width = pad_width;
|
||||
if (height)
|
||||
*height = pad_height;
|
||||
*width = pad_width;
|
||||
*height = pad_height;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue