+ /* unlock so it doesn't block on chain function while changing state */
+ g_mutex_unlock (&downloader->priv->lock);
+
+ GST_DEBUG_OBJECT (downloader, "Stopping source element %s",
+ GST_ELEMENT_NAME (urisrc));
+
+ /* set the element state to NULL */
+ gst_element_set_state (urisrc, GST_STATE_NULL);
+ gst_element_get_state (urisrc, NULL, NULL, GST_CLOCK_TIME_NONE);
+ gst_element_set_bus (urisrc, NULL);
+ gst_object_unref (urisrc);
+
+ /* caller expects the mutex to be locked */
+ g_mutex_lock (&downloader->priv->lock);