summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2015-11-07 00:43:55 +0100
committerThibault Saunier <tsaunier@gnome.org>2015-11-07 00:46:47 +0100
commit629b63d1f29e2504baf254dd66725fe16eb01152 (patch)
tree4b59cd0f80e28fa4a7a7bd8d68f3d714ca9b8386
parentd0eface01c9af0ab1d61fe4916ca945ae0679af7 (diff)
discoverer: Check API arguments and assert if needed
-rw-r--r--gst-libs/gst/pbutils/gstdiscoverer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c
index 2964933d5..ec2b47fc0 100644
--- a/gst-libs/gst/pbutils/gstdiscoverer.c
+++ b/gst-libs/gst/pbutils/gstdiscoverer.c
@@ -1962,6 +1962,8 @@ gst_discoverer_start (GstDiscoverer * discoverer)
GSource *source;
GMainContext *ctx = NULL;
+ g_return_if_fail (GST_IS_DISCOVERER (discoverer));
+
GST_DEBUG_OBJECT (discoverer, "Starting...");
if (discoverer->priv->async) {
@@ -1999,6 +2001,8 @@ gst_discoverer_start (GstDiscoverer * discoverer)
void
gst_discoverer_stop (GstDiscoverer * discoverer)
{
+ g_return_if_fail (GST_IS_DISCOVERER (discoverer));
+
GST_DEBUG_OBJECT (discoverer, "Stopping...");
if (!discoverer->priv->async) {
@@ -2064,6 +2068,8 @@ gst_discoverer_discover_uri_async (GstDiscoverer * discoverer,
{
gboolean can_run;
+ g_return_val_if_fail (GST_IS_DISCOVERER (discoverer), FALSE);
+
GST_DEBUG_OBJECT (discoverer, "uri : %s", uri);
DISCO_LOCK (discoverer);
@@ -2101,6 +2107,9 @@ gst_discoverer_discover_uri (GstDiscoverer * discoverer, const gchar * uri,
GstDiscovererResult res = 0;
GstDiscovererInfo *info;
+ g_return_val_if_fail (GST_IS_DISCOVERER (discoverer), NULL);
+ g_return_val_if_fail (uri, NULL);
+
GST_DEBUG_OBJECT (discoverer, "uri:%s", uri);
DISCO_LOCK (discoverer);
@@ -2194,6 +2203,8 @@ gst_discoverer_info_to_variant (GstDiscovererInfo * info,
GstDiscovererStreamInfo *sinfo = gst_discoverer_info_get_stream_info (info);
GVariant *wrapper;
+ g_return_val_if_fail (GST_IS_DISCOVERER_INFO (info), NULL);
+
stream_variant = gst_discoverer_info_to_variant_recurse (sinfo, flags);
variant =
g_variant_new ("(vv)", _serialize_info (info, flags), stream_variant);