From 99b94015a75e04f02acb7189e8b697fd0f605f4d Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Tue, 25 Mar 2025 10:16:47 +0000 Subject: [PATCH] gst: src: Fix buffer pool handling in case of caps renegotiation In case negotiation is first attempted with unfixed caps, bufferpool support was unconditionally disabled. Then at a second caps negotiation attempt it wasn't restored according to the property value. --- src/gst/gstpipewiresrc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index 1cd049418..05d759011 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -1127,14 +1127,15 @@ handle_format_change (GstPipeWireSrc *pwsrc, #ifdef HAVE_GSTREAMER_DMA_DRM } #endif + } else { + /* Don't provide bufferpool for audio if not requested by the + * application/user */ + if (pwsrc->use_bufferpool != USE_BUFFERPOOL_YES) + pwsrc->use_bufferpool = USE_BUFFERPOOL_NO; } } else { pwsrc->negotiated = FALSE; pwsrc->is_video = FALSE; - - /* Don't provide bufferpool for audio if not requested by the application/user */ - if (pwsrc->use_bufferpool != USE_BUFFERPOOL_YES) - pwsrc->use_bufferpool = USE_BUFFERPOOL_NO; } if (pwsrc->caps) {