uri-asset: do not reuse a passed GError pointer

Summary: A passed GError is re-allocated when discoverer has no information.

Reviewers: thiblahute

Projects: #gstreamer_editing_services

Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D302
This commit is contained in:
Justin Kim 2015-10-02 16:08:03 +02:00 committed by Thibault Saunier
parent 0defd9a893
commit 46f9cbdf4f
2 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,5 @@
{
"phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/api\/"
"phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/api\/",
"repository.callsign" : "GES",
"project": "GStreamer Editing Services"
}

View file

@ -344,6 +344,7 @@ static void
discoverer_discovered_cb (GstDiscoverer * discoverer,
GstDiscovererInfo * info, GError * err, gpointer user_data)
{
GError *error = NULL;
const GstTagList *tags;
const gchar *uri = gst_discoverer_info_get_uri (info);
@ -356,13 +357,20 @@ discoverer_discovered_cb (GstDiscoverer * discoverer,
if (gst_discoverer_info_get_result (info) == GST_DISCOVERER_OK) {
ges_uri_clip_asset_set_info (mfs, info);
} else if (!err) {
err = g_error_new (GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_FAILED,
"Stream %s discovering failed (error code: %d)",
uri, gst_discoverer_info_get_result (info));
} else {
if (err) {
error = g_error_copy (err);
} else {
error = g_error_new (GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_FAILED,
"Stream %s discovering failed (error code: %d)",
uri, gst_discoverer_info_get_result (info));
}
}
ges_asset_cache_set_loaded (GES_TYPE_URI_CLIP, uri, err);
ges_asset_cache_set_loaded (GES_TYPE_URI_CLIP, uri, error);
if (error)
g_error_free (error);
}
/* API implementation */