From efa08e98922d12cd79252e99fa69ab72afc765d6 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Fri, 27 Oct 2023 16:50:06 +0200 Subject: [PATCH] gst: update buffer size only if format defines a size For encoded formats, p->video_info.size will be 0. If the pipewiresrc handles an encoded format, the bufferpool will be configured to allocate buffers of size 0. This will cause errors later when trying to copy the frames into the pipewire buffers. Update the bufferpool size only if video_info defines an actual buffer size. --- src/gst/gstpipewirepool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gst/gstpipewirepool.c b/src/gst/gstpipewirepool.c index f99a52863..676a2d054 100644 --- a/src/gst/gstpipewirepool.c +++ b/src/gst/gstpipewirepool.c @@ -228,7 +228,10 @@ set_config (GstBufferPool * pool, GstStructure * config) p->add_metavideo = has_video && gst_buffer_pool_config_has_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); - gst_buffer_pool_config_set_params (config, caps, p->video_info.size, min_buffers, max_buffers); + if (p->video_info.size != 0) + size = p->video_info.size; + + gst_buffer_pool_config_set_params (config, caps, size, min_buffers, max_buffers); return GST_BUFFER_POOL_CLASS (gst_pipewire_pool_parent_class)->set_config (pool, config); }