0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

linux-pipewire: Only consider chunks with size set

Compositors did not agree on how to communicate invalid buffers until
recently, so e0a4d8628d 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.
This commit is contained in:
Kurt Kartaltepe 2023-04-22 14:28:50 -07:00 committed by Jim
parent 9da4a37cbc
commit f0f704249f

View File

@ -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;