diff options
author | Vineeth TM <vineeth.tm@samsung.com> | 2015-08-19 08:37:46 +0900 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-08-19 10:20:58 +0300 |
commit | b632b206e122f154b23a04c217d2fbb2927a95e6 (patch) | |
tree | 1c4cd6a640f50a8405be68a465c44d8ec1d5a1d5 | |
parent | 2727ca01f5596b7c28d7bb55d3853a883f51e414 (diff) |
tools: discoverer: When info is NULL just print error and return
In case discover_uri returns NULL info, passing the info to discoverer APIs
result in critical assertion errors. Hence instead of passing NULL info along,
print the error and return.
https://bugzilla.gnome.org/show_bug.cgi?id=753701
-rw-r--r-- | tools/gst-discoverer.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c index 2c088e56d..16468aeee 100644 --- a/tools/gst-discoverer.c +++ b/tools/gst-discoverer.c @@ -381,9 +381,16 @@ print_properties (GstDiscovererInfo * info, gint tab) static void print_info (GstDiscovererInfo * info, GError * err) { - GstDiscovererResult result = gst_discoverer_info_get_result (info); + GstDiscovererResult result; GstDiscovererStreamInfo *sinfo; + if (!info) { + g_print ("Could not discover URI\n"); + g_print (" %s\n", err->message); + return; + } + + result = gst_discoverer_info_get_result (info); g_print ("Done discovering %s\n", gst_discoverer_info_get_uri (info)); switch (result) { case GST_DISCOVERER_OK: |