[gnome-remote-desktop] vnc-pipewire-stream: Don't queue chosen PipeWire buffer



commit d206e42ad206e51fb6d28c254b949efdb374cbdd
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Fri Mar 4 07:46:18 2022 +0100

    vnc-pipewire-stream: Don't queue chosen PipeWire buffer
    
    When choosing the latest PipeWire buffer with a mouse pointer bitmap
    and the latest PipeWire buffer with frame data, the same buffer can be
    chosen for the mouse pointer bitmap and the frame data.
    If there is in a further step another buffer with a mouse pointer
    bitmap and it is chosen for the latest mouse pointer bitmap, then the
    current PipeWire buffer won't be queued, because it is still chosen for
    the latest frame data.
    However, if the situation is the opposite, where first the same buffer
    was chosen for the latest mouse pointer bitmap and the frame data, and
    then the next buffer has no mouse pointer bitmap, but new frame
    data, then the current buffer is queued again, although it is still
    chosen for the latest mouse pointer bitmap.
    
    Fix this situation by applying the same-buffer-logic in the mouse
    pointer bitmap path to the frame data path as well.

 src/grd-vnc-pipewire-stream.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 7e1e2dd4..cc1a29b9 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -635,6 +635,9 @@ on_stream_process (void *user_data)
         }
       if (grd_pipewire_buffer_has_frame_data (next_buffer))
         {
+          if (last_pointer_buffer == last_frame_buffer)
+            last_frame_buffer = NULL;
+
           if (last_frame_buffer)
             pw_stream_queue_buffer (stream->pipewire_stream, last_frame_buffer);
           last_frame_buffer = next_buffer;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]