From 2d0cab20c0fb0be3f9a91b055d4d12fc468eab53 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 10 Apr 2019 11:56:59 +1000 Subject: [PATCH] vkswapper: don't output duplicate formats --- ext/vulkan/vkswapper.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/vulkan/vkswapper.c b/ext/vulkan/vkswapper.c index afbaf1dd13..eb7286be3f 100644 --- a/ext/vulkan/vkswapper.c +++ b/ext/vulkan/vkswapper.c @@ -156,17 +156,20 @@ static void _add_vk_format_to_list (GValue * list, VkFormat format) { GstVideoFormat v_format; - const gchar *format_str; v_format = _vk_format_to_video_format (format); if (v_format) { + const gchar *format_str = gst_video_format_to_string (v_format); GValue item = G_VALUE_INIT; + GValue new_list = G_VALUE_INIT; g_value_init (&item, G_TYPE_STRING); - format_str = gst_video_format_to_string (v_format); g_value_set_string (&item, format_str); - gst_value_list_append_value (list, &item); + gst_value_list_merge (&new_list, list, &item); g_value_unset (&item); + + g_value_unset (list); + *list = new_list; } }