Index: browser-plugin/totemPlugin.cpp
===================================================================
RCS file: /cvs/gnome/totem/browser-plugin/totemPlugin.cpp,v
retrieving revision 1.38
diff -u -p -r1.38 totemPlugin.cpp
--- browser-plugin/totemPlugin.cpp	24 Oct 2006 20:05:37 -0000	1.38
+++ browser-plugin/totemPlugin.cpp	25 Oct 2006 11:05:18 -0000
@@ -823,6 +823,12 @@ totemPlugin::NewStream (NPMIMEType type,
 {
 	D("plugin_new_stream");
 
+	//FIXME is this good enough? How about redirects and stuff?
+	if (stream_ptr->url && strcmp (stream_ptr->url, mSrc) != 0) {
+		D("plugin_new_stream exiting, not the stream expected");
+		return NPERR_GENERIC_ERROR;
+	}
+
 	/* We already have a live stream */
 	if (mStream) {
 		D("plugin_new_stream exiting, already have a live stream");
@@ -856,6 +862,11 @@ totemPlugin::DestroyStream (NPStream* st
 			    NPError reason)
 {
 	D("plugin_destroy_stream, reason: %d", reason);
+
+	/* Don't close this if it's not the stream we're
+	 * interested in */
+	if (stream == mStream)
+		return NPERR_NO_ERROR;
 
 	if (mSendFD >= 0) {
 		close(mSendFD);
