diff options
author | Thibault Saunier <tsaunier@gnome.org> | 2014-12-03 11:12:55 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-12-16 15:10:24 +0100 |
commit | f5139c2b7b7d29e7544c9bb138f3dfafd76b8730 (patch) | |
tree | 3e34e8ab0554da270fbe19fe47c71c4d9b755f24 | |
parent | 700b571ed5b3927e8cfc740d25942dd892029ff1 (diff) |
rtpjitterbuffer: Use an empty iterator in iterate_internal_link when no links
We used to setup an iterator with 1 GValue set with a NULL object
pointer which is not the normal way to do that. Instead we should make
sure that the first call to gst_iterator_next returns GST_ITERATOR_DONE.
-rw-r--r-- | gst/rtpmanager/gstrtpjitterbuffer.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 1239161f6..7b1f25594 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -821,7 +821,7 @@ gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad, GstObject * parent) { GstRtpJitterBuffer *jitterbuffer; GstPad *otherpad = NULL; - GstIterator *it; + GstIterator *it = NULL; GValue val = { 0, }; jitterbuffer = GST_RTP_JITTER_BUFFER_CAST (parent); @@ -831,13 +831,15 @@ gst_rtp_jitter_buffer_iterate_internal_links (GstPad * pad, GstObject * parent) } else if (pad == jitterbuffer->priv->srcpad) { otherpad = jitterbuffer->priv->sinkpad; } else if (pad == jitterbuffer->priv->rtcpsinkpad) { - otherpad = NULL; + it = gst_iterator_new_single (GST_TYPE_PAD, NULL); } - g_value_init (&val, GST_TYPE_PAD); - g_value_set_object (&val, otherpad); - it = gst_iterator_new_single (GST_TYPE_PAD, &val); - g_value_unset (&val); + if (it == NULL) { + g_value_init (&val, GST_TYPE_PAD); + g_value_set_object (&val, otherpad); + it = gst_iterator_new_single (GST_TYPE_PAD, &val); + g_value_unset (&val); + } return it; } |