[gnome-remote-desktop] vnc-pipewire-stream: Skip corrupted buffers
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] vnc-pipewire-stream: Skip corrupted buffers
- Date: Wed, 10 Aug 2022 10:19:04 +0000 (UTC)
commit 9ae17006a9eefb649ec0500dc6bdb68951ca7a75
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Fri Jul 29 19:14:48 2022 +0200
vnc-pipewire-stream: Skip corrupted buffers
With [0] mutter now also sends additional header data for each SPA
buffer.
This header contains a flag field, where mutter can specify, that a SPA
buffer is corrupted.
This flag is necessary, as queued PipeWire buffers, which wrap around
SPA buffers, MUST be queued again, after dequeuing them.
So, if setting the data in the SPA buffer fails, the buffer MUST be
ignored.
So, look for the header data in each SPA buffer. If available, and the
SPA_META_HEADER_FLAG_CORRUPTED flag is set, skip the buffer, instead of
trying to process it.
[0]: https://gitlab.gnome.org/GNOME/mutter/-/commit/30b5229e0eeb5117fe3061cfcc1d1e59c199f4d9
src/grd-vnc-pipewire-stream.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 6a295ff6..9295849d 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -545,6 +545,18 @@ on_stream_process (void *user_data)
while ((next_buffer = pw_stream_dequeue_buffer (stream->pipewire_stream)))
{
+ struct spa_meta_header *spa_meta_header;
+
+ spa_meta_header = spa_buffer_find_meta_data (next_buffer->buffer,
+ SPA_META_Header,
+ sizeof (struct spa_meta_header));
+ if (spa_meta_header &&
+ spa_meta_header->flags & SPA_META_HEADER_FLAG_CORRUPTED)
+ {
+ pw_stream_queue_buffer (stream->pipewire_stream, next_buffer);
+ continue;
+ }
+
maybe_consume_pointer_position (next_buffer, &cursor_moved,
&cursor_x, &cursor_y);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]