{
const GstStructure *struct1 = (const GstStructure *) data;
const GValue *value1 = gst_structure_id_get_value (struct1, field_id);
-
gdouble d1, d2;
+ if (value1 == NULL) {
+ /* no value with this field id, clearly not equal */
+ return FALSE;
+ }
+
if (gst_value_compare (value1, value2) == GST_VALUE_EQUAL)
return TRUE;
gst_tag_list_unref (tags);
gst_tag_list_unref (tags2);
+ /* test comparing lists with equal length but different items */
+
+ tags = gst_tag_list_new_empty ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Foo", NULL);
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_ARTIST, "Bar", NULL);
+
+ tags2 = gst_tag_list_new_empty ();
+ gst_tag_list_add (tags2, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, "Foo", NULL);
+ gst_tag_list_add (tags2, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, "Bar", NULL);
+
+ fail_unless (!gst_tag_list_is_equal (tags2, tags));
+
+ gst_tag_list_unref (tags);
+ gst_tag_list_unref (tags2);
+
/* samples */
buf = gst_buffer_new_wrapped (g_strdup ("test 1-2-3"), 10);
sample1 = gst_sample_new (buf, NULL, NULL, NULL);