validate: media-descriptor-writer: Don't create media info when stream info is not...
authorVineeth T M <vineeth.tm@samsung.com>
Mon, 24 Aug 2015 03:30:57 +0000 (12:30 +0900)
committerThibault Saunier <tsaunier@gnome.org>
Tue, 17 Nov 2015 09:10:10 +0000 (10:10 +0100)
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

index d30947b..ea43bd0 100644 (file)
@@ -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;