mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
glvideomixer/compositor: Correctly error out if calculating DAR fails
CID 1320700
This commit is contained in:
parent
d520d1b3ed
commit
a064590912
2 changed files with 10 additions and 7 deletions
|
@ -962,9 +962,13 @@ _mixer_pad_get_output_size (GstGLVideoMixer * mix,
|
||||||
mix_pad->height <=
|
mix_pad->height <=
|
||||||
0 ? GST_VIDEO_INFO_HEIGHT (&vagg_pad->info) : mix_pad->height;
|
0 ? GST_VIDEO_INFO_HEIGHT (&vagg_pad->info) : mix_pad->height;
|
||||||
|
|
||||||
gst_video_calculate_display_ratio (&dar_n, &dar_d, pad_width, pad_height,
|
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_N (&vagg_pad->info),
|
||||||
GST_VIDEO_INFO_PAR_D (&vagg_pad->info), out_par_n, out_par_d);
|
GST_VIDEO_INFO_PAR_D (&vagg_pad->info), out_par_n, out_par_d)) {
|
||||||
|
GST_WARNING_OBJECT (mix_pad, "Cannot calculate display aspect ratio");
|
||||||
|
*width = *height = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
GST_LOG_OBJECT (mix_pad, "scaling %ux%u by %u/%u (%u/%u / %u/%u)", pad_width,
|
GST_LOG_OBJECT (mix_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),
|
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);
|
GST_VIDEO_INFO_PAR_D (&vagg_pad->info), out_par_n, out_par_d);
|
||||||
|
@ -977,10 +981,8 @@ _mixer_pad_get_output_size (GstGLVideoMixer * mix,
|
||||||
pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d);
|
pad_width = gst_util_uint64_scale_int (pad_height, dar_n, dar_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width)
|
*width = pad_width;
|
||||||
*width = pad_width;
|
*height = pad_height;
|
||||||
if (height)
|
|
||||||
*height = pad_height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
|
|
@ -244,6 +244,7 @@ _mixer_pad_get_output_size (GstCompositor * comp,
|
||||||
GST_VIDEO_INFO_PAR_D (&vagg_pad->info), out_par_n, out_par_d)) {
|
GST_VIDEO_INFO_PAR_D (&vagg_pad->info), out_par_n, out_par_d)) {
|
||||||
GST_WARNING_OBJECT (comp_pad, "Cannot calculate display aspect ratio");
|
GST_WARNING_OBJECT (comp_pad, "Cannot calculate display aspect ratio");
|
||||||
*width = *height = 0;
|
*width = *height = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
GST_LOG_OBJECT (comp_pad, "scaling %ux%u by %u/%u (%u/%u / %u/%u)", pad_width,
|
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),
|
pad_height, dar_n, dar_d, GST_VIDEO_INFO_PAR_N (&vagg_pad->info),
|
||||||
|
|
Loading…
Reference in a new issue