Commit ee36beb2 authored by Thibault Saunier's avatar Thibault Saunier
Browse files

uri-asset: Check if file exists before trying it as a proxy

This avoids:

  1- discovering file that we know do not exist
  2- proposing the current proxy path (that failed) as a possible proxy
     which lead to errors
parent 87ca058e
......@@ -587,7 +587,9 @@ ges_asset_set_proxy (GESAsset * asset, const gchar * new_id)
return FALSE;
} else if (g_strcmp0 (asset->priv->proxied_asset_id, new_id) == 0) {
GST_WARNING_OBJECT (asset, "Trying to proxy to same currently set proxy");
GST_WARNING_OBJECT (asset,
"Trying to proxy to same currently set proxy: %s -- %s",
asset->priv->proxied_asset_id, new_id);
return FALSE;
}
......
......@@ -141,7 +141,12 @@ _request_id_update (GESAsset * self, gchar ** proposed_new_id, GError * error)
gchar *basename = g_file_get_basename (file);
GFile *new_file = g_file_get_child (new_parent, basename);
/* FIXME Handle the GCancellable */
if (g_file_query_exists (file, NULL)) {
*proposed_new_id = g_file_get_uri (new_file);
GST_DEBUG_OBJECT (self, "Proposing path: %s as proxy",
*proposed_new_id);
}
gst_object_unref (new_file);
g_free (basename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment