screencast: HACK set an arbitrary chunk size for dmabufs

Clients have wrongly used the chunk size to detect if a buffer was valid
or not. Since dmabufs might not have a well defined buffer size we will
set an arbitrary value until clients are patched.
This commit is contained in:
columbarius 2022-03-05 12:27:33 +01:00
parent 0683f7ca7e
commit 852e1c95c7

View file

@ -233,6 +233,12 @@ static void pwr_handle_stream_add_buffer(void *data, struct pw_buffer *buffer) {
d[0].flags = 0; d[0].flags = 0;
d[0].fd = xdpw_buffer->fd; d[0].fd = xdpw_buffer->fd;
d[0].data = NULL; d[0].data = NULL;
// clients have implemented to check chunk->size if the buffer is valid instead
// of using the flags. Until they are patched we should use some arbitrary value.
if (xdpw_buffer->buffer_type == DMABUF && d[0].chunk->size == 0) {
d[0].chunk->size = 9; // This was choosen by a fair d20.
}
} }
static void pwr_handle_stream_remove_buffer(void *data, struct pw_buffer *buffer) { static void pwr_handle_stream_remove_buffer(void *data, struct pw_buffer *buffer) {