mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-13 01:35:30 +00:00
This patch prevents a possible race condition from taking place between the EOS event handling and rtcp send function/thread. The condition starts by getting the GST_EVENT_EOS event on the send_rtp_sink pad, which causes two core things to happen -- the event gets pushed down to the send_rtp_src pad and all sessions get marked "bye" prior to completion of the event handler. In another thread the rtp_session_on_timeout function gets called after an expiration of gst_clock_id_wait in the rtcp_thread function. This results in a call to the ess->callbacks.send_rtcp(), which is configured as a function pointer to gst_rtp_session_send_rtcp via the RTPSessionCallbacks structure passed to rtp_session_set_callbacks in the gst_rtp_session_init function. In the race condition, the call to gst_rtp_session_send_rtcp can have the all_sources_bye boolean set to true while GST_PAD_IS_EOS(rtpsession->send_rtp_sink) evaluates to false. This is the result of gst_rtp_session_send_rtcp running before the send_rtp_sink's GST_EVENT_EOS handler completes. The exact point at which this condition occurs is if there's a context switch to the rtcp_thread right after the call to rtp_session_mark_all_bye in the GET_EVENT_EOS handler, but before the handler returns. Normally, this would not be an issue because the rtcp_thread continues to run and indirectly call gst_rtp_session_send_rtcp. However, the call to rtp_source_reset sets the sent_bye boolean to false, which ends up causing rtp_session_are_all_sources_bye to return false. This gets passed to gst_rtp_session_send_rtcp and the EOS event never gets sent. The race condition results in the EOS event never getting passed to the rtcp_src pad, which prevents the bin and pipeline from ever completing with EOS. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3798> |
||
---|---|---|
.. | ||
alpha | ||
apetag | ||
audiofx | ||
audioparsers | ||
auparse | ||
autodetect | ||
avi | ||
cutter | ||
debugutils | ||
deinterlace | ||
dtmf | ||
effectv | ||
equalizer | ||
flv | ||
flx | ||
goom | ||
goom2k1 | ||
icydemux | ||
id3demux | ||
imagefreeze | ||
interleave | ||
isomp4 | ||
law | ||
level | ||
matroska | ||
monoscope | ||
multifile | ||
multipart | ||
replaygain | ||
rtp | ||
rtpmanager | ||
rtsp | ||
shapewipe | ||
smpte | ||
spectrum | ||
udp | ||
videobox | ||
videocrop | ||
videofilter | ||
videomixer | ||
wavenc | ||
wavparse | ||
xingmux | ||
y4m | ||
meson.build |