From 03f7820d2c0ee08cead97427f314a05166706939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 May 2011 18:38:53 +0200 Subject: [PATCH] streamselector: Return a NULL iterator instead of an empty iterator that returns NULL if there's no otherpad --- gst/playback/gststreamselector.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gst/playback/gststreamselector.c b/gst/playback/gststreamselector.c index 573a90bc7a..4e0ac15ea1 100644 --- a/gst/playback/gststreamselector.c +++ b/gst/playback/gststreamselector.c @@ -635,16 +635,16 @@ gst_stream_selector_pad_iterate_linked_pads (GstPad * pad) GstStreamSelector *sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad)); GValue value = { 0, }; GstPad *otherpad; - GstIterator *ret; + GstIterator *ret = NULL; otherpad = gst_stream_selector_get_linked_pad (pad, TRUE); - g_value_init (&value, GST_TYPE_PAD); - g_value_set_object (&value, otherpad); - ret = gst_iterator_new_single (GST_TYPE_PAD, &value); - g_value_unset (&value); - - if (otherpad) + if (otherpad) { + g_value_init (&value, GST_TYPE_PAD); + g_value_set_object (&value, otherpad); + ret = gst_iterator_new_single (GST_TYPE_PAD, &value); + g_value_unset (&value); gst_object_unref (otherpad); + } gst_object_unref (sel); return ret;