mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
gsturi: Set GError if uri is invalid
GError should be set if function call failed and the failed reason is not a programmer error. Fixed: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1380 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/816>
This commit is contained in:
parent
ed92fb2430
commit
2936448f1a
1 changed files with 4 additions and 0 deletions
|
@ -638,6 +638,8 @@ gst_element_make_from_uri (const GstURIType type, const gchar * uri,
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||||
|
|
||||||
if (!gst_uri_is_valid (uri)) {
|
if (!gst_uri_is_valid (uri)) {
|
||||||
|
g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
|
||||||
|
_("Invalid URI: %s"), uri);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -809,6 +811,8 @@ gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri,
|
||||||
g_return_val_if_fail (iface->set_uri != NULL, FALSE);
|
g_return_val_if_fail (iface->set_uri != NULL, FALSE);
|
||||||
|
|
||||||
if (!gst_uri_is_valid (uri)) {
|
if (!gst_uri_is_valid (uri)) {
|
||||||
|
g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
|
||||||
|
_("Invalid URI: %s"), uri);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue