From 680ca5e10f89fc48134d3c1fbf3005ceeae723d7 Mon Sep 17 00:00:00 2001 From: Vineeth T M Date: Mon, 24 Aug 2015 12:30:57 +0900 Subject: [PATCH] validate: media-descriptor-writer: Don't create media info when stream info is not present. When a file does not contain any stream info, then there is no need to create the media info file as, it is not considered to be a valid file and no validate checks are done for the same. This skips unnecessary files like .txt, .dump files https://bugzilla.gnome.org/show_bug.cgi?id=754006 --- validate/gst/validate/media-descriptor-writer.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c index d30947b..ea43bd0 100644 --- a/validate/gst/validate/media-descriptor-writer.c +++ b/validate/gst/validate/media-descriptor-writer.c @@ -563,22 +563,22 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner, } } - writer = - gst_media_descriptor_writer_new (runner, - gst_discoverer_info_get_uri (info), - gst_discoverer_info_get_duration (info), - gst_discoverer_info_get_seekable (info)); + streaminfo = gst_discoverer_info_get_stream_info (info); - if (handle_g_logs) - gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (writer)); + if (streaminfo) { + writer = + gst_media_descriptor_writer_new (runner, + gst_discoverer_info_get_uri (info), + gst_discoverer_info_get_duration (info), + gst_discoverer_info_get_seekable (info)); - tags = gst_discoverer_info_get_tags (info); - if (tags) - gst_media_descriptor_writer_add_taglist (writer, tags); + if (handle_g_logs) + gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (writer)); - streaminfo = gst_discoverer_info_get_stream_info (info); + tags = gst_discoverer_info_get_tags (info); + if (tags) + gst_media_descriptor_writer_add_taglist (writer, tags); - if (streaminfo) { if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) { ((GstMediaDescriptor *) writer)->filenode->caps = gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO @@ -594,6 +594,7 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner, } else { GST_VALIDATE_REPORT (writer, FILE_NO_STREAM_INFO, "Discoverer info, does not contain the stream info"); + goto out; } media_descriptor = (GstMediaDescriptor *) writer; -- 2.7.4