From: Sebastian Dröge Date: Thu, 21 May 2015 13:24:48 +0000 (+0300) Subject: compositor/glvideomixer: Don't calculate PAR/DAR with unset GstVideoInfos X-Git-Tag: 1.19.3~511^2~1294^2~201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3b806de4e7b4f08e2f757449d036395632cd0b2;p=platform%2Fupstream%2Fgstreamer.git compositor/glvideomixer: Don't calculate PAR/DAR with unset GstVideoInfos Otherwise we divide by zero. --- diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index 148c702..6ae693d 100644 --- a/ext/gl/gstglvideomixer.c +++ b/ext/gl/gstglvideomixer.c @@ -630,6 +630,15 @@ _mixer_pad_get_output_size (GstGLVideoMixer * mix, gint pad_width, pad_height; guint dar_n, dar_d; + /* FIXME: Anything better we can do here? */ + if (!vagg_pad->info.finfo + || vagg_pad->info.finfo->format == GST_VIDEO_FORMAT_UNKNOWN) { + GST_DEBUG_OBJECT (mix_pad, "Have no caps yet"); + *width = 0; + *height = 0; + return; + } + pad_width = mix_pad->width <= 0 ? GST_VIDEO_INFO_WIDTH (&vagg_pad->info) : mix_pad->width; diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c index 4967cdc..dfeb379 100644 --- a/gst/compositor/compositor.c +++ b/gst/compositor/compositor.c @@ -223,6 +223,15 @@ _mixer_pad_get_output_size (GstCompositor * comp, gint pad_width, pad_height; guint dar_n, dar_d; + /* FIXME: Anything better we can do here? */ + if (!vagg_pad->info.finfo + || vagg_pad->info.finfo->format == GST_VIDEO_FORMAT_UNKNOWN) { + GST_DEBUG_OBJECT (comp_pad, "Have no caps yet"); + *width = 0; + *height = 0; + return; + } + pad_width = comp_pad->width <= 0 ? GST_VIDEO_INFO_WIDTH (&vagg_pad->info) : comp_pad->width;