Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2903 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5182>