From f5fc34ae830767d8bd909ad0c916f3f9c49c2a58 Mon Sep 17 00:00:00 2001 From: Havard Graff Date: Sun, 23 Feb 2020 23:44:16 +0100 Subject: [PATCH] rtpfunnel: copy caps before sending them in a caps-event Reason being we don't want downstream to own a ref to our internal caps. Part-of: --- gst/rtpmanager/gstrtpfunnel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/rtpmanager/gstrtpfunnel.c b/gst/rtpmanager/gstrtpfunnel.c index ec70cf6331..8e54cd1a80 100644 --- a/gst/rtpmanager/gstrtpfunnel.c +++ b/gst/rtpmanager/gstrtpfunnel.c @@ -155,6 +155,7 @@ static void gst_rtp_funnel_send_sticky (GstRtpFunnel * funnel, GstPad * pad) { GstEvent *stream_start; + GstCaps *caps; GstEvent *caps_ev; if (!funnel->send_sticky_events) @@ -166,7 +167,9 @@ gst_rtp_funnel_send_sticky (GstRtpFunnel * funnel, GstPad * pad) goto done; } - caps_ev = gst_event_new_caps (funnel->srccaps); + caps = gst_caps_copy (funnel->srccaps); + caps_ev = gst_event_new_caps (caps); + gst_caps_unref (caps); if (caps_ev && !gst_pad_push_event (funnel->srcpad, caps_ev)) { GST_ERROR_OBJECT (funnel, "Could not push caps"); goto done;