summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2014-12-03 11:12:55 +0100
committerThibault Saunier <tsaunier@gnome.org>2014-12-03 11:17:11 +0100
commitaa89278adeead49f6cf1101b640dba8b3c97ba27 (patch)
tree5dbdf3383ac2afdd0aa2468849fe989a9bbac230
parentb3d1ab52672ac4ca5af7c1aa174c16d7c9a93153 (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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 3695e1562..fee6b60ba 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -860,7 +860,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);
@@ -870,13 +870,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;
}