screen-cast/src: Clean up DMA-BUF only error paths

When a stream source subclass asks for a DMA-BUF only frame record,
it is legitimate to return FALSE in do_record_frame() - meaning that
a frame was not recorded - but not return an error - meaning nothing
actually failed.

This avoids spamming the journal with warnings on a legitimate case.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2804>
This commit is contained in:
Georges Basile Stavracas Neto 2022-12-03 19:15:19 -03:00 committed by Robert Mader
parent 16aa2943e2
commit ded7b8dfba

View File

@ -516,6 +516,9 @@ do_record_frame (MetaScreenCastStreamSrc *src,
gboolean dmabuf_only;
dmabuf_only = flags & META_SCREEN_CAST_RECORD_FLAG_DMABUF_ONLY;
if (dmabuf_only && spa_buffer->datas[0].type != SPA_DATA_DmaBuf)
return FALSE;
if (!dmabuf_only &&
(spa_buffer->datas[0].data ||
spa_buffer->datas[0].type == SPA_DATA_MemFd))
@ -818,6 +821,7 @@ meta_screen_cast_stream_src_maybe_record_frame_with_timestamp (MetaScreenCastStr
}
else
{
if (error)
g_warning ("Failed to record screen cast frame: %s", error->message);
spa_buffer->datas[0].chunk->size = 0;
spa_buffer->datas[0].chunk->flags = SPA_CHUNK_FLAG_CORRUPTED;