gchar *output_file = NULL;
gchar *expected_file = NULL;
gchar *output = NULL;
- GstMediaDescriptorWriter *writer;
- GstValidateRunner *runner;
+ GstMediaDescriptorWriter *writer = NULL;
+ GstValidateRunner *runner = NULL;
GstMediaDescriptorParser *reference = NULL;
GOptionEntry options[] = {
g_printerr ("%s\n", msg);
g_free (msg);
g_option_context_free (ctx);
- return 1;
+ ret = 1;
+ goto out;
}
g_option_context_free (ctx);
gst_media_descriptor_writer_new_discover (runner, argv[1], full, &err);
if (writer == NULL) {
g_print ("Could not discover file: %s", argv[1]);
- return 1;
+ ret = 1;
+ goto out;
}
if (output_file)
if (reference == NULL) {
g_print ("Could not parse file: %s", expected_file);
gst_object_unref (writer);
-
- return 1;
+ ret = 1;
+ goto out;
}
gst_media_descriptors_compare (GST_MEDIA_DESCRIPTOR (reference),
g_free (output);
}
+out:
+ g_free (output_file);
+ g_free (expected_file);
+
if (reference)
gst_object_unref (reference);
- gst_object_unref (writer);
- gst_object_unref (runner);
+ if (writer)
+ gst_object_unref (writer);
+ if (runner)
+ gst_object_unref (runner);
gst_deinit ();
return ret;