--- backends/gstreamer/rb-player-gst-xfade-orig.c	2008-05-21 13:39:50.000000000 +0100
+++ backends/gstreamer/rb-player-gst-xfade.c	2008-05-21 17:29:33.000000000 +0100
@@ -2308,6 +2308,7 @@
 		      NULL);
 
 	/* update stream state */
+	g_static_mutex_lock(&stream->lock);
 	switch (stream->state) {
 	case PREROLLING:
 		rb_debug ("stream %s is prerolled, not starting yet -> WAITING", stream->uri);
@@ -2324,6 +2325,7 @@
 		rb_debug ("didn't expect to get preroll completion callback in this state (%d)", stream->state);
 		break;
 	}
+	g_static_mutex_unlock(&stream->lock);
 }
 
 /*
@@ -2342,6 +2344,8 @@
 	gboolean ret = TRUE;
 	gboolean unblock = FALSE;
 
+	g_static_mutex_lock(&stream->lock);
+
 	gst_pad_set_blocked_async (stream->src_pad,
 				   TRUE,
 				   (GstPadBlockCallback) stream_src_blocked_cb,
@@ -2388,6 +2392,7 @@
 					   NULL);
 	}
 
+	g_static_mutex_unlock(&stream->lock);
 	return ret;
 }
 
