summaryrefslogtreecommitdiff
path: root/gst/rtp
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2021-05-07 11:13:46 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-05-07 12:07:05 +0000
commit88d7141ba404bf00d4c720fc66774be24e50b93e (patch)
tree7385afd8a0b9c29728a7f11d036639f27b80f619 /gst/rtp
parentddac6ab91d22c7b7b4be6992ab0c09ae13d8b824 (diff)
downloadgstreamer-plugins-bad-88d7141ba404bf00d4c720fc66774be24e50b93e.tar.gz
rtpsink: Return proper pad from _request_new_pad
Bizarrely, it returned a pad from the child rtpbin. I noticed because our application leaked the implicitly created ghost pad. Make an explicit ghost pad so this works properly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2227>
Diffstat (limited to 'gst/rtp')
-rw-r--r--gst/rtp/gstrtpsink.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gst/rtp/gstrtpsink.c b/gst/rtp/gstrtpsink.c
index 83739fb01..4ef6ca755 100644
--- a/gst/rtp/gstrtpsink.c
+++ b/gst/rtp/gstrtpsink.c
@@ -241,7 +241,7 @@ gst_rtp_sink_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
{
GstRtpSink *self = GST_RTP_SINK (element);
- GstPad *pad = NULL;
+ GstPad *rpad, *pad = NULL;
if (self->rtpbin == NULL) {
GST_ELEMENT_ERROR (self, CORE, MISSING_PLUGIN, (NULL),
@@ -253,7 +253,12 @@ gst_rtp_sink_request_new_pad (GstElement * element,
return NULL;
GST_RTP_SINK_LOCK (self);
- pad = gst_element_request_pad_simple (self->rtpbin, "send_rtp_sink_%u");
+ rpad = gst_element_request_pad_simple (self->rtpbin, "send_rtp_sink_%u");
+ if (rpad) {
+ pad = gst_ghost_pad_new (GST_PAD_NAME (rpad), rpad);
+ gst_element_add_pad (element, pad);
+ gst_clear_object (&rpad);
+ }
GST_RTP_SINK_UNLOCK (self);
g_return_val_if_fail (pad != NULL, NULL);