Commit 1c489376 authored by Jan Schmidt's avatar Jan Schmidt Committed by Sebastian Dröge

rtspclientsink: Don't deadlock in preroll on early close

If the connection is closed very early, the flushing
marker might not get set and rtspclientsink can get
deadlocked waiting for preroll forever.
parent 0d846d4c
......@@ -2006,7 +2006,10 @@ gst_rtsp_conninfo_close (GstRTSPClientSink * sink, GstRTSPConnInfo * info,
/* free connection */
GST_DEBUG_OBJECT (sink, "freeing connection...");
gst_rtsp_connection_free (info->connection);
g_mutex_lock (&sink->preroll_lock);
info->connection = NULL;
g_cond_broadcast (&sink->preroll_cond);
g_mutex_unlock (&sink->preroll_lock);
return GST_RTSP_OK;
......@@ -3585,7 +3588,8 @@ gst_rtsp_client_sink_collect_streams (GstRTSPClientSink * sink)
/* Now wait for the preroll of the rtp bin */
g_mutex_lock (&sink->preroll_lock);
while (!sink->prerolled && !sink->conninfo.flushing) {
while (!sink->prerolled && sink->conninfo.connection
&& !sink->conninfo.flushing) {
GST_LOG_OBJECT (sink, "Waiting for preroll before continuing");
g_cond_wait (&sink->preroll_cond, &sink->preroll_lock);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment