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.
This commit is contained in:
Rafostar
2022-05-15 20:01:53 +02:00
parent c6c43346fa
commit 4e3cc3e23f

View File

@@ -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);