From 1d1b218d97a70660b0b7970139d646dcacad4054 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 16 Mar 2022 17:49:10 +0100 Subject: [PATCH] screencast: better solution for missing context on cursor move There's no need to use tryEnqueue if we only update the cursor --- src/plugins/screencast/screencaststream.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/screencast/screencaststream.cpp b/src/plugins/screencast/screencaststream.cpp index a02c119bd8..aae80c24bc 100644 --- a/src/plugins/screencast/screencaststream.cpp +++ b/src/plugins/screencast/screencaststream.cpp @@ -500,18 +500,16 @@ void ScreenCastStream::recordCursor() return; } - struct pw_buffer *buffer = pw_stream_dequeue_buffer(pwStream); - - if (!buffer) { + m_pendingBuffer = pw_stream_dequeue_buffer(pwStream); + if (!m_pendingBuffer) { return; } - struct spa_buffer *spa_buffer = buffer->buffer; + struct spa_buffer *spa_buffer = m_pendingBuffer->buffer; spa_buffer->datas[0].chunk->size = 0; sendCursorData(Cursors::self()->currentCursor(), (spa_meta_cursor *) spa_buffer_find_meta_data (spa_buffer, SPA_META_Cursor, sizeof (spa_meta_cursor))); - - tryEnqueue(buffer); + enqueue(); } void ScreenCastStream::tryEnqueue(pw_buffer *buffer)