vkswapper: don't output duplicate formats

This commit is contained in:
Matthew Waters 2019-04-10 11:56:59 +10:00
parent 25dd3b32e5
commit 2d0cab20c0

View file

@ -156,17 +156,20 @@ static void
_add_vk_format_to_list (GValue * list, VkFormat format) _add_vk_format_to_list (GValue * list, VkFormat format)
{ {
GstVideoFormat v_format; GstVideoFormat v_format;
const gchar *format_str;
v_format = _vk_format_to_video_format (format); v_format = _vk_format_to_video_format (format);
if (v_format) { if (v_format) {
const gchar *format_str = gst_video_format_to_string (v_format);
GValue item = G_VALUE_INIT; GValue item = G_VALUE_INIT;
GValue new_list = G_VALUE_INIT;
g_value_init (&item, G_TYPE_STRING); g_value_init (&item, G_TYPE_STRING);
format_str = gst_video_format_to_string (v_format);
g_value_set_string (&item, format_str); 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 (&item);
g_value_unset (list);
*list = new_list;
} }
} }