From 9230a6af6a76b889a658c0c7c5050a9176c880a8 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 7 Oct 2013 22:51:04 +0200 Subject: [PATCH] discoverer: early return when we have no streams --- gst-libs/gst/pbutils/gstdiscoverer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 9808b9d9df..bfb50cd7c8 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -967,6 +967,10 @@ find_stream_for_node (GstDiscoverer * dc, const GstStructure * topology) guint i; GList *tmp; + if (!dc->priv->streams) { + return NULL; + } + if (!gst_structure_id_has_field (topology, _TOPOLOGY_PAD_QUARK)) { GST_DEBUG ("Could not find pad for node %" GST_PTR_FORMAT, topology); return NULL; @@ -975,11 +979,6 @@ find_stream_for_node (GstDiscoverer * dc, const GstStructure * topology) gst_structure_id_get (topology, _TOPOLOGY_PAD_QUARK, GST_TYPE_PAD, &pad, NULL); - if (!dc->priv->streams) { - gst_object_unref (pad); - return NULL; - } - for (i = 0, tmp = dc->priv->streams; tmp; tmp = tmp->next, i++) { ps = (PrivateStream *) tmp->data;