rtsp-media: wait for all GstRTSPStreamBlocking messages
authorLudvig Rappe <ludvigr@axis.com>
Tue, 26 May 2020 13:31:22 +0000 (15:31 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 27 May 2020 16:35:49 +0000 (16:35 +0000)
commitae58f7d771998539087a975b2b8a3942f9b7d516
tree75ab508183e76ff1516f7ee03f3f35e022726483
parent0526a5c9bb07642f8d3bb050835723dc91758292
rtsp-media: wait for all GstRTSPStreamBlocking messages

Make sure rtsp-media have received a GstRTSPStreamBlocking message from
each active stream when checking if all streams are blocked.

Without this change there will be a race condition when using two or
more streams and rtsp-media receives a GstRTSPStreamBlocking message
from one of the streams. This is because rtsp-media then checks if all
streams are blocked by calling gst_rtsp_stream_is_blocking() for each
stream. This function call returns TRUE if the stream has sent a
GstRTSPStreamBlocking message, however, rtsp-media may have yet to
receive this message. This would then result in that rtsp-media
erroneously thinks it is blocking all streams which could result in
rtsp-media changing state, from PREPARING to PREPARED. In the case of a
preroll, this could result in that rtsp-media thinks that the pipeline
is prerolled even though that might not be the case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/124>
gst/rtsp-server/rtsp-media.c