discoverer: early return when we have no streams

This commit is contained in:
Stefan Sauer 2013-10-07 22:51:04 +02:00
parent 2e1b1699fe
commit 9230a6af6a

View file

@ -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;