mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
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>
This commit is contained in:
parent
ddac6ab91d
commit
88d7141ba4
1 changed files with 7 additions and 2 deletions
|
@ -241,7 +241,7 @@ gst_rtp_sink_request_new_pad (GstElement * element,
|
||||||
GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
|
GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstRtpSink *self = GST_RTP_SINK (element);
|
GstRtpSink *self = GST_RTP_SINK (element);
|
||||||
GstPad *pad = NULL;
|
GstPad *rpad, *pad = NULL;
|
||||||
|
|
||||||
if (self->rtpbin == NULL) {
|
if (self->rtpbin == NULL) {
|
||||||
GST_ELEMENT_ERROR (self, CORE, MISSING_PLUGIN, (NULL),
|
GST_ELEMENT_ERROR (self, CORE, MISSING_PLUGIN, (NULL),
|
||||||
|
@ -253,7 +253,12 @@ gst_rtp_sink_request_new_pad (GstElement * element,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
GST_RTP_SINK_LOCK (self);
|
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);
|
GST_RTP_SINK_UNLOCK (self);
|
||||||
|
|
||||||
g_return_val_if_fail (pad != NULL, NULL);
|
g_return_val_if_fail (pad != NULL, NULL);
|
||||||
|
|
Loading…
Reference in a new issue