From 55039373378d722ad0b60d4cfe9ee1a0d416ec96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 21 May 2015 16:24:48 +0300 Subject: [PATCH] compositor/glvideomixer: Don't calculate PAR/DAR with unset GstVideoInfos Otherwise we divide by zero. --- ext/gl/gstglvideomixer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index 148c702610..6ae693df18 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;