GNOME Bugzilla – Bug 704441
Preparing a media blocks the server thread
Last modified: 2013-10-04 04:49:34 UTC
gst_rtsp_media_prepare() currently is called from the main server thread, and does a g_cond_wait_until() until the media pipeline is pre-rolled. As this can take some time depending on the pipeline, the server thread will be blocked for some time. And especially a) can't take any new connections during that time (allowed backlog there is 5 currently, easy to drop connections) and b) can't send anything to already connected clients (creating bursts afterwards and potential fillup of the GstRTSPConnection backlog, or dropping of packets, or ...) Instead of the GCond this should probably be done by stopping code flow for this media after the pipeline is set to PLAYING, at the place where the GCond is currently signaled add an idle callback to the main context and from there continue the code flow as before.
Solotions to run the client and prepare in a different thread has been implementated a long time ago...
Also clients are now running in a separate thread by default anyway, and this behaviour can be controlled with the thread pool. So there's at least no risk to drop new connections with the default behaviour. Marking as enhancement, not really an urgent need :)
Closing, not sure what needs to be done more here.