summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineeth TM <vineeth.tm@samsung.com>2015-08-17 10:31:33 +0900
committerThibault Saunier <tsaunier@gnome.org>2015-10-02 17:39:00 +0200
commit15c87003b8c48a473b1160a5d93e12b06f3fe90c (patch)
treecdaa02da369b1d19c22388f1622572d50bea729e
parent5c0c42ed6d8c26c19e90fb3a0f8e347141f79db3 (diff)
validate: descriptor-writer: Handle NULL GError address and free GError during error cases
writer_new_discover() API should be able to accept NULL GError and in case of error, if GError is passed on as parameter, it should be propagated, else it should be free'd. https://bugzilla.gnome.org/show_bug.cgi?id=753340
-rw-r--r--validate/gst/validate/media-descriptor-writer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c
index 12a772a..d30947b 100644
--- a/validate/gst/validate/media-descriptor-writer.c
+++ b/validate/gst/validate/media-descriptor-writer.c
@@ -515,19 +515,21 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
GstMediaDescriptorWriter *writer = NULL;
GstMediaDescriptor *media_descriptor;
const GstTagList *tags;
+ GError *error = NULL;
- discoverer = gst_discoverer_new (GST_SECOND * 60, err);
+ discoverer = gst_discoverer_new (GST_SECOND * 60, &error);
if (discoverer == NULL) {
GST_ERROR ("Could not create discoverer");
-
+ g_propagate_error (err, error);
return NULL;
}
- info = gst_discoverer_discover_uri (discoverer, uri, err);
- if (info == NULL && err && *err) {
- GST_ERROR ("Could not discover URI: %s (error: %s)", uri, (*err)->message);
+ info = gst_discoverer_discover_uri (discoverer, uri, &error);
+ if (error) {
+ GST_ERROR ("Could not discover URI: %s (error: %s)", uri, error->message);
+ g_propagate_error (err, error);
goto out;
} else {
GstDiscovererResult result = gst_discoverer_info_get_result (info);