From 5809ef62f5e8b12a9cbaf8ec8efac814563bf13e Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Fri, 13 Oct 2023 15:37:27 +0200 Subject: [PATCH] screen-cast/stream-src: Calculate stride after adding handle to hash table `calculate_stride()` looks up the dmabuf handle from the hash table so we need to add it first. Fixes 9b663f44e6044ece52c38b3ee23bbc2b55328b47 Part-of: --- src/backends/meta-screen-cast-stream-src.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index cf198cf64..fd49c5339 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -1134,12 +1134,12 @@ on_stream_add_buffer (void *data, spa_data->flags = SPA_DATA_FLAG_READWRITE; spa_data->fd = cogl_dma_buf_handle_get_fd (dmabuf_handle); - stride = meta_screen_cast_stream_src_calculate_stride (src, spa_data); - spa_data->maxsize = stride * priv->video_format.size.height; - g_hash_table_insert (priv->dmabuf_handles, GINT_TO_POINTER (spa_data->fd), dmabuf_handle); + + stride = meta_screen_cast_stream_src_calculate_stride (src, spa_data); + spa_data->maxsize = stride * priv->video_format.size.height; } else {