mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
kmssink: Fix crash with force-modesetting=1
This is a master regression, we would allocate a bo without having created the allocator yet. As of now, we lazily create the allocator.
This commit is contained in:
parent
af32ca45fa
commit
115b65d1ab
1 changed files with 9 additions and 8 deletions
|
@ -415,6 +415,14 @@ get_drm_caps (GstKMSSink * self)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_kms_allocator (GstKMSSink * self)
|
||||
{
|
||||
if (self->allocator)
|
||||
return;
|
||||
self->allocator = gst_kms_allocator_new (self->fd);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo)
|
||||
{
|
||||
|
@ -436,6 +444,7 @@ configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo)
|
|||
|
||||
GST_INFO_OBJECT (self, "configuring mode setting");
|
||||
|
||||
ensure_kms_allocator (self);
|
||||
kmsmem = (GstKMSMemory *) gst_kms_allocator_bo_alloc (self->allocator, vinfo);
|
||||
if (!kmsmem)
|
||||
goto bo_failed;
|
||||
|
@ -1008,14 +1017,6 @@ gst_kms_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
|
|||
return out_caps;
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_kms_allocator (GstKMSSink * self)
|
||||
{
|
||||
if (self->allocator)
|
||||
return;
|
||||
self->allocator = gst_kms_allocator_new (self->fd);
|
||||
}
|
||||
|
||||
static GstBufferPool *
|
||||
gst_kms_sink_create_pool (GstKMSSink * self, GstCaps * caps, gsize size,
|
||||
gint min)
|
||||
|
|
Loading…
Reference in a new issue