[Bug 767021] RTSP server won't be destroyed until media is pre-rolled (or 20s timeout)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Jun 2 14:02:11 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=767021

--- Comment #4 from Xavier Claessens <xclaesse at gmail.com> ---
Context: I'm writing an (android) application that let the user start/stop
sharing his webcam over RTSP. When the user stops the RTSP server I want to
free all resources it takes, so I would like to call
gst_rtsp_thread_pool_cleanup().

Wihtout this patch it is racy, because after calling gst_rtsp_client_close() on
all existing clients, one of them could be in the middle of the process of
preparing its media. For example it could be in find_media(), just before doing
gst_rtsp_thread_pool_get_thread(). If gst_rtsp_thread_pool_cleanup() comes
first, then the client push a thread in the pool, it crash.

Also a client could be blocking in wait_preroll(), and since I'm shutting down
my pipeline, chances are it will never reach the PAUSED state and thus block in
waiting preroll until a 20s timeout. The patch fix that case by calling
gst_rtsp_media_unprepare() on preparing medias when their client gets closed.


Note that I'm *really* unsure if I'm doing it right, this is the first time I
touch rtsp-server code. At least in my use case I couldn't reproduce
crash/freeze anymore...

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list