From 073a97a9f5903a957860f38b122276154d22ae31 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Thu, 5 Oct 2023 15:01:54 +0200 Subject: [PATCH] backend-pipewire: skip rendering and free if there is no renderbuffer The PipeWire backend is only able to render into renderbuffers and passing NULL to the renderer is not valid. Don't try to use the renderbuffer if a buffer without renderbuffer is dequeued from PipeWire. Signed-off-by: Michael Tretter --- libweston/backend-pipewire/pipewire.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libweston/backend-pipewire/pipewire.c b/libweston/backend-pipewire/pipewire.c index 707799d8..884710a6 100644 --- a/libweston/backend-pipewire/pipewire.c +++ b/libweston/backend-pipewire/pipewire.c @@ -560,7 +560,8 @@ pipewire_output_stream_remove_buffer(void *data, struct pw_buffer *buffer) pipewire_output_debug(output, "remove buffer: %p", buffer); - weston_renderbuffer_unref(frame_data->renderbuffer); + if (frame_data->renderbuffer) + weston_renderbuffer_unref(frame_data->renderbuffer); free(frame_data); } @@ -746,7 +747,10 @@ pipewire_output_repaint(struct weston_output *base) pipewire_output_debug(output, "dequeued buffer: %p", buffer); frame_data = buffer->user_data; - ec->renderer->repaint_output(&output->base, &damage, frame_data->renderbuffer); + if (frame_data->renderbuffer) + ec->renderer->repaint_output(&output->base, &damage, frame_data->renderbuffer); + else + output->base.full_repaint_needed = true; pipewire_submit_buffer(output, buffer);