Browse Source

linux-pipewire: Only consider chunks with size set

Compositors did not agree on how to communicate invalid buffers until
recently, so e0a4d8628d287217cebc3d05d2077e1f0709b450 resulted in
regressions on KDE. This restores our old behavior which is too
conservative but mostly works on old and new compositors (which contain
similar workarounds to pass in invalid but non-zero sizes for dma-bufs).

Once all old compositors are out of use we can remove this workaround
and then compositors can remove their random size workaround.
Kurt Kartaltepe 2 years ago
parent
commit
f0f704249f
1 changed files with 3 additions and 2 deletions
  1. 3 2
      plugins/linux-pipewire/pipewire.c

+ 3 - 2
plugins/linux-pipewire/pipewire.c

@@ -578,13 +578,14 @@ static void on_process_cb(void *user_data)
 		blog(LOG_ERROR, "[pipewire] buffer is corrupt");
 		pw_stream_queue_buffer(obs_pw->stream, b);
 		return;
-	} else if (!header) {
-		has_buffer = buffer->datas[0].chunk->size != 0;
 	}
 
 	obs_enter_graphics();
 
+	// Workaround for kwin behaviour pre 5.27.5
 	// Workaround for mutter behaviour pre GNOME 43
+	// Only check this if !SPA_META_Header, once supported platforms update.
+	has_buffer = buffer->datas[0].chunk->size != 0;
 	if (!has_buffer)
 		goto read_metadata;