mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
validate: descriptor-writer: Print proper error message when discover fails
When discovering the files, there will be different kind of errors. If we print the exact message, then it will be more helpful for user. Especially in the case of missing plugins, displaying which plugin is missing as error message https://bugzilla.gnome.org/show_bug.cgi?id=752758
This commit is contained in:
parent
185b3b2d7e
commit
97e630efba
1 changed files with 32 additions and 5 deletions
|
@ -525,13 +525,40 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
|
|||
}
|
||||
|
||||
info = gst_discoverer_discover_uri (discoverer, uri, err);
|
||||
if (info == NULL
|
||||
|| gst_discoverer_info_get_result (info) != GST_DISCOVERER_OK) {
|
||||
|
||||
GST_ERROR ("Could not discover URI: %s (error: %s(", uri,
|
||||
err && *err ? (*err)->message : "Unkown");
|
||||
if (info == NULL && err && *err) {
|
||||
GST_ERROR ("Could not discover URI: %s (error: %s)", uri, (*err)->message);
|
||||
|
||||
goto out;
|
||||
} else {
|
||||
GstDiscovererResult result = gst_discoverer_info_get_result (info);
|
||||
switch (result) {
|
||||
case GST_DISCOVERER_OK:
|
||||
break;
|
||||
case GST_DISCOVERER_URI_INVALID:
|
||||
GST_ERROR ("URI is not valid");
|
||||
goto out;
|
||||
case GST_DISCOVERER_TIMEOUT:
|
||||
GST_ERROR ("Analyzing URI timed out\n");
|
||||
goto out;
|
||||
case GST_DISCOVERER_BUSY:
|
||||
GST_ERROR ("Discoverer was busy\n");
|
||||
goto out;
|
||||
case GST_DISCOVERER_MISSING_PLUGINS:
|
||||
{
|
||||
gint i = 0;
|
||||
const gchar **installer_details =
|
||||
gst_discoverer_info_get_missing_elements_installer_details (info);
|
||||
GST_ERROR ("Missing plugins");
|
||||
while (installer_details[i]) {
|
||||
GST_ERROR ("(%s)", installer_details[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
goto out;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
writer =
|
||||
|
|
Loading…
Reference in a new issue