rtpssrcdemux: fix "data flow before segment event" crash
authorHavard Graff <havard@pexip.com>
Fri, 21 May 2021 12:19:29 +0000 (14:19 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 25 May 2021 22:04:41 +0000 (22:04 +0000)
commit26c94af2ea91458e3abe543b0bee7379d9cf7e33
tree6ad0cb81f00b83ee011243521cab098c6fd66085
parentde3a3882e92891a8a85376091974949346ea31fa
rtpssrcdemux: fix "data flow before segment event" crash

This crash could happen at any time a RTP and RTCP buffer arrived
simultaneously in ssrcdemux.

The problem was that sticky-event arriving while the rtp and rtcp pads
were being set up could arrive just too late to be included in the initial
forwarding.

The fix checks if the stickies have been sent on the srcpad about to be
pushed on, and if not sends them. It also blocks any stickes from
being forwarded *prior* to this happening, to avoid them arriving on
the srcpad multiple times.

Since the test loops 1000 times, this will make running under valgrind
take forever, so use the RUNNING_ON_VALGRIND variable to detect we
are running under valgrind, and reduce the loop-count to 2 in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/992>
gst/rtpmanager/gstrtpssrcdemux.c
tests/check/elements/rtpssrcdemux.c