From 40fbffc208707bad3f8da0de01e5e4ecb2595db9 Mon Sep 17 00:00:00 2001 From: Paolo Pettinato Date: Tue, 12 Apr 2016 09:41:00 +0000 Subject: [PATCH] rtpmux: Forward sticky events on buffer lists too, not only on buffers https://bugzilla.gnome.org/show_bug.cgi?id=764933 --- gst/rtpmanager/gstrtpmux.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/rtpmanager/gstrtpmux.c b/gst/rtpmanager/gstrtpmux.c index cbb4e86..faf4a62 100644 --- a/gst/rtpmanager/gstrtpmux.c +++ b/gst/rtpmanager/gstrtpmux.c @@ -420,6 +420,9 @@ process_list_item (GstBuffer ** buffer, guint idx, gpointer user_data) return TRUE; } +static gboolean resend_events (GstPad * pad, GstEvent ** event, + gpointer user_data); + static GstFlowReturn gst_rtp_mux_chain_list (GstPad * pad, GstObject * parent, GstBufferList * bufferlist) @@ -427,6 +430,7 @@ gst_rtp_mux_chain_list (GstPad * pad, GstObject * parent, GstRTPMux *rtp_mux; GstFlowReturn ret; GstRTPMuxPadPrivate *padpriv; + gboolean changed = FALSE; struct BufferListData bd; rtp_mux = GST_RTP_MUX (parent); @@ -459,8 +463,17 @@ gst_rtp_mux_chain_list (GstPad * pad, GstObject * parent, bufferlist = gst_buffer_list_make_writable (bufferlist); gst_buffer_list_foreach (bufferlist, process_list_item, &bd); + if (!bd.drop && pad != rtp_mux->last_pad) { + changed = TRUE; + g_clear_object (&rtp_mux->last_pad); + rtp_mux->last_pad = g_object_ref (pad); + } + GST_OBJECT_UNLOCK (rtp_mux); + if (changed) + gst_pad_sticky_events_foreach (pad, resend_events, rtp_mux); + if (bd.drop) { gst_buffer_list_unref (bufferlist); ret = GST_FLOW_OK; -- 2.7.4