summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-06-06 17:44:15 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-06-07 10:06:50 +0300
commitaa9cb3695afe1e2c1c868050f849a76100fbeb1d (patch)
tree675838616fa31322ea179fce56fa089d36b261f7
parent0da9474b84d5d1b6dacbeb6e27c3aa25a2460018 (diff)
ges-uri-asset: GstDiscoverer can return a valid info but a non-OK result, consider this an error
The asynchronous case in ges_uri_clip_asset_request_async() already considered it an error, do the same in ges_uri_clip_asset_request_sync(). https://bugzilla.gnome.org/show_bug.cgi?id=767293
-rw-r--r--ges/ges-uri-asset.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ges/ges-uri-asset.c b/ges/ges-uri-asset.c
index 90b3cfd6..e349c44b 100644
--- a/ges/ges-uri-asset.c
+++ b/ges/ges-uri-asset.c
@@ -519,12 +519,24 @@ ges_uri_clip_asset_request_sync (const gchar * uri, GError ** error)
info = gst_discoverer_discover_uri (discoverer, uri, &lerror);
}
+ /* We might get a discoverer info but it might have a non-OK result. We
+ * should consider that an error */
+ if (!lerror && info
+ && gst_discoverer_info_get_result (info) != GST_DISCOVERER_OK) {
+ lerror =
+ 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_put (gst_object_ref (asset), NULL);
ges_uri_clip_asset_set_info (asset, info);
ges_asset_cache_set_loaded (GES_TYPE_URI_CLIP, uri, lerror);
if (info == NULL || lerror != NULL) {
gst_object_unref (asset);
+ if (info)
+ gst_discoverer_info_unref (info);
if (lerror)
g_propagate_error (error, lerror);