From 4e3cc3e23fc9e17b2e8d831002cf6ef4cbb4dfc2 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sun, 15 May 2022 20:01:53 +0200 Subject: [PATCH] plugin: Set initial display resolution to 1x1 We do not support zero width/height (described in our caps). Set initial video dimensions to 1x1. They are going to be updated on first buffer after video info is set. This avoids running into https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1139 and makes sure we do not do any divisions by zero here either. --- lib/gst/plugin/gstclapperpaintable.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/gst/plugin/gstclapperpaintable.c b/lib/gst/plugin/gstclapperpaintable.c index 494e0275..27dbc22e 100644 --- a/lib/gst/plugin/gstclapperpaintable.c +++ b/lib/gst/plugin/gstclapperpaintable.c @@ -53,6 +53,10 @@ gst_clapper_paintable_class_init (GstClapperPaintableClass *klass) static void gst_clapper_paintable_init (GstClapperPaintable *self) { + self->display_width = 1; + self->display_height = 1; + self->display_aspect_ratio = 1.0; + self->par_n = DEFAULT_PAR_N; self->par_d = DEFAULT_PAR_D; self->pixel_aspect = ((gdouble) self->par_d / self->par_n);