diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index f575c65b6b..823b86d3ff 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4674,6 +4674,9 @@ gst_rtspsrc_close (GstRTSPSrc * src) /* stop task if any */ if (src->task) { + /* release lock before trying to get the streamlock */ + GST_RTSP_STATE_UNLOCK (src); + gst_task_stop (src->task); /* make sure it is not running */ @@ -4686,6 +4689,8 @@ gst_rtspsrc_close (GstRTSPSrc * src) /* and free the task */ gst_object_unref (GST_OBJECT (src->task)); src->task = NULL; + + GST_RTSP_STATE_LOCK (src); } if (!src->connection)