diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c index 4a5356b625..6de5e2f7cf 100644 --- a/validate/gst/validate/media-descriptor-writer.c +++ b/validate/gst/validate/media-descriptor-writer.c @@ -162,11 +162,13 @@ serialize_filenode (GstMediaDescriptorWriter * writer) STR_APPEND1 (""); tagsnode = filenode->tags; - STR_APPEND1 (tagsnode->str_open); - for (tmp2 = tagsnode->tags; tmp2; tmp2 = tmp2->next) { - STR_APPEND2 (((TagNode *) tmp2->data)->str_open); + if (tagsnode) { + STR_APPEND1 (tagsnode->str_open); + for (tmp2 = tagsnode->tags; tmp2; tmp2 = tmp2->next) { + STR_APPEND2 (((TagNode *) tmp2->data)->str_open); + } + STR_APPEND1 (tagsnode->str_close); } - STR_APPEND1 (tagsnode->str_close); g_string_append (res, filenode->str_close); @@ -467,8 +469,8 @@ _run_frame_analisis (GstMediaDescriptorWriter * writer, writer->priv->pipeline = gst_pipeline_new ("frame-analisis"); monitor = - gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer->priv-> - pipeline), runner, NULL); + gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer-> + priv->pipeline), runner, NULL); gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor)); g_object_set (uridecodebin, "uri", uri, "caps", writer->priv->raw_caps, NULL); diff --git a/validate/gst/validate/media-descriptor.c b/validate/gst/validate/media-descriptor.c index a39a0b565d..5f22b0288c 100644 --- a/validate/gst/validate/media-descriptor.c +++ b/validate/gst/validate/media-descriptor.c @@ -215,10 +215,48 @@ compare_tags (GstMediaDescriptor * ref, StreamNode * rstream, TagsNode *rtags, *ctags; rtags = rstream->tags; - if (rtags == NULL) - return 1; - ctags = cstream->tags; + if (rtags == NULL && ctags) + return 1; + else if (!rtags && ctags) { + GList *taglist; + GString *all_tags = g_string_new (NULL); + + for (taglist = ctags->tags; taglist; taglist = taglist->next) { + gchar *stags = + gst_tag_list_to_string (((TagNode *) taglist->data)->taglist); + + g_string_append_printf (all_tags, "%s\n", stags); + g_free (stags); + } + + GST_VALIDATE_REPORT (ref, FILE_TAG_DETECTION_INCORRECT, + "Reference descriptor for stream %s has NO tags" + " but tags found: %s", all_tags->str); + + g_string_free (all_tags, TRUE); + + return 0; + } else if (rtags && !ctags) { + GList *taglist; + GString *all_tags = g_string_new (NULL); + + for (taglist = rtags->tags; taglist; taglist = taglist->next) { + gchar *stags = + gst_tag_list_to_string (((TagNode *) taglist->data)->taglist); + + g_string_append_printf (all_tags, "%s\n", stags); + g_free (stags); + } + + GST_VALIDATE_REPORT (ref, FILE_TAG_DETECTION_INCORRECT, + "Reference descriptor for stream %s has tags:\n %s\n" + " but NO tags found on the stream"); + + g_string_free (all_tags, TRUE); + return 0; + } + for (rtag_list = rtags->tags; rtag_list; rtag_list = rtag_list->next) { rtag = rtag_list->data; found = FALSE;