rtpsession: Fix another instance of sticky event misordering warnings

Make sure that the sync_src pad has caps before the segment event.
Otherwise we might get a segment event before caps from the receive
RTCP pad, and then later when receiving RTCP packets will set caps.
This will results in a sticky event misordering warning

This fixes warnings in the rtpaux unit test but also in the
rtpaux and rtx examples in tests/examples/rtp

https://bugzilla.gnome.org/show_bug.cgi?id=746445
This commit is contained in:
Sebastian Dröge 2015-03-21 17:50:40 +01:00
parent 17d90b453f
commit 0e3609a6e1

View file

@ -1773,6 +1773,18 @@ gst_rtp_session_event_recv_rtcp_sink (GstPad * pad, GstObject * parent,
GST_EVENT_TYPE_NAME (event)); GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:
/* Make sure that the sync_src pad has caps before the segment event.
* Otherwise we might get a segment event before caps from the receive
* RTCP pad, and then later when receiving RTCP packets will set caps.
* This will results in a sticky event misordering warning
*/
if (!gst_pad_has_current_caps (rtpsession->sync_src)) {
GstCaps *caps = gst_caps_new_empty_simple ("application/x-rtcp");
gst_pad_set_caps (rtpsession->sync_src, caps);
gst_caps_unref (caps);
}
/* fall through */
default: default:
ret = gst_pad_push_event (rtpsession->sync_src, event); ret = gst_pad_push_event (rtpsession->sync_src, event);
break; break;