ges: uri-clip: Set error on invalid URI's in check_id

The _check_id function signature was incomplete and the last GError
argument was ignored instead of being properly used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5981>
This commit is contained in:
Philippe Normand 2023-11-22 10:42:07 +00:00 committed by GStreamer Marge Bot
parent 03d07e8e52
commit fa8a2ec55e

View file

@ -192,11 +192,13 @@ ges_uri_clip_class_init (GESUriClipClass * klass)
} }
static gchar * static gchar *
extractable_check_id (GType type, const gchar * id) extractable_check_id (GType type, const gchar * id, GError ** error)
{ {
if (gst_uri_is_valid (id)) if (gst_uri_is_valid (id))
return g_strdup (id); return g_strdup (id);
g_set_error (error, GES_ERROR, GES_ERROR_ASSET_WRONG_ID, "URI %s is invalid",
id);
return NULL; return NULL;
} }
@ -442,7 +444,7 @@ static void
ges_extractable_interface_init (GESExtractableInterface * iface) ges_extractable_interface_init (GESExtractableInterface * iface)
{ {
iface->asset_type = GES_TYPE_URI_CLIP_ASSET; iface->asset_type = GES_TYPE_URI_CLIP_ASSET;
iface->check_id = (GESExtractableCheckId) extractable_check_id; iface->check_id = extractable_check_id;
iface->get_parameters_from_id = extractable_get_parameters_from_id; iface->get_parameters_from_id = extractable_get_parameters_from_id;
iface->get_id = extractable_get_id; iface->get_id = extractable_get_id;
iface->can_update_asset = TRUE; iface->can_update_asset = TRUE;