Assertion failure when multiple clients connect to a stream that's using segment seeking
I work on a system that starts an RTSP stream using a video file as a source and uses segment seeking to seamlessly loop the video file. I turn on segment seeking by creating a subclass of
GstRtspServer.RTSPMedia that overrides
do_handle_message and listens for state changes. When a new RTSP stream is created, the client and server connect to the RTSP stream at about the same time, which results in this assertion failure:
ERROR:../gst/rtsp-server/rtsp-media.c:2713:gst_rtsp_media_get_rates: assertion failed: (FALSE) Bail out! ERROR:../gst/rtsp-server/rtsp-media.c:2713:gst_rtsp_media_get_rates: assertion failed: (FALSE) Aborted (core dumped)
This code used to work fine on 1.16.2, so this looks like a regression.
I think this is a race condition, because it doesn't seem to happen if the server's thread pool is turned off or if the two connections are established one after the other.
I have a minimal (but still rather long, sorry) reproduction script that triggers the problem ~25% of the time available as a Gist. It's in Python, but if it makes things any easier I can try to reproduce this issue in C.
OS: Ubuntu 18.04 in Docker
GStreamer Version: 1.18.0
Python Version: 3.6