? foo
Index: totem-mozilla-plugin.cpp
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-plugin.cpp,v
retrieving revision 1.19
diff -u -r1.19 totem-mozilla-plugin.cpp
--- totem-mozilla-plugin.cpp	28 Mar 2005 16:59:08 -0000	1.19
+++ totem-mozilla-plugin.cpp	28 Mar 2005 17:23:36 -0000
@@ -177,6 +177,9 @@
 		if (g_ascii_strcasecmp (argn[i], "height") == 0) {
 			plugin->height = strtol (argv[i], NULL, 0);
 		}
+		if (g_ascii_strcasecmp (argn[i], "type") == 0) {
+			plugin->mimetype = g_strdup (argv[i]);
+		}
 		//FIXME we can have some relative paths here as well!
 		if (g_ascii_strcasecmp (argn[i], "src") == 0) {
 			plugin->src = g_strdup (argv[i]);
@@ -237,6 +240,7 @@
 	delete plugin->iface;
 	bacon_message_connection_free (plugin->conn);
 	g_free (plugin->last_msg);
+	g_free (plugin->mimetype);
 	mozilla_functions.memfree (instance->pdata);
 	instance->pdata = NULL;
 
@@ -287,11 +291,19 @@
 static NPError totem_plugin_new_stream (NPP instance, NPMIMEType type,
 		NPStream* stream_ptr, NPBool seekable, uint16* stype)
 {
+	TotemPlugin *plugin;
+
 	DEBUG("plugin_new_stream");
 
 	if (instance == NULL)
 		return NPERR_INVALID_INSTANCE_ERROR;
 
+	plugin = (TotemPlugin *) instance->pdata;
+
+	if (strcmp (plugin->mimetype, "audio/x-pn-realaudio-plugin") == 0) {
+		return NPERR_INVALID_URL;
+	}
+
 	return NPERR_NO_ERROR;
 }
 
@@ -309,8 +321,10 @@
 
 	plugin = (TotemPlugin *) instance->pdata;
 
-	close(plugin->send_fd);
-	plugin->send_fd = -1;
+	if (plugin->send_fd > 0) {
+		close(plugin->send_fd);
+		plugin->send_fd = -1;
+	}
 
 	return NPERR_NO_ERROR;
 }
@@ -459,7 +473,7 @@
 	return totem_plugin_get_value (NULL, variable, value);
 }
 
-#define NUM_MIME_TYPES 4
+#define NUM_MIME_TYPES 5
 static struct {
 	const char *mime_type;
 	const char *extensions;
@@ -468,7 +482,8 @@
 	{ "video/quicktime", "mov" },
 	{ "application/x-mplayer2", "avi, wma, wmv", "video/x-msvideo" },
 	{ "video/mpeg", "mpg, mpeg, mpe" },
-	{ "video/x-ms-asf-plugin", "asf, wmv", "video/x-ms-asf" }
+	{ "video/x-ms-asf-plugin", "asf, wmv", "video/x-ms-asf" },
+	{ "audio/x-pn-realaudio-plugin", "ram, rm", "audio/x-pn-realaudio" }
 };
 
 char *NP_GetMIMEDescription(void)
Index: totem-mozilla-scriptable.h
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-scriptable.h,v
retrieving revision 1.3
diff -u -r1.3 totem-mozilla-scriptable.h
--- totem-mozilla-scriptable.h	28 Mar 2005 16:59:08 -0000	1.3
+++ totem-mozilla-scriptable.h	28 Mar 2005 17:23:37 -0000
@@ -31,19 +31,18 @@
 class totemMozillaObject;
 
 typedef struct {
-        NPP instance;
-        guint32 window;
+	NPP instance;
+	guint32 window;
 	totemMozillaObject *iface;
 
-        char *src, *href;
-        int width, height;
+	char *src, *href;
+	int width, height;
 	BaconMessageConnection *conn;
-	gchar *last_msg;
-        int send_fd;
-        int player_pid;
-        gboolean controller_hidden;
-
-        GByteArray *bytes;
+	char *last_msg;
+	char *mimetype;
+	int send_fd;
+	int player_pid;
+	gboolean controller_hidden;
 } TotemPlugin;
 
 class totemMozillaMix : public nsIClassInfo {
