? attachment.cgi?id=70545&action=view
? foo
? plparse/attachment.cgi?id=70506&action=view
? plparse/m_wwdc_2006_350_ref.mov
Index: totem-mozilla-interface.xml
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-interface.xml,v
retrieving revision 1.2
diff -u -p -r1.2 totem-mozilla-interface.xml
--- totem-mozilla-interface.xml	19 Jun 2006 11:58:50 -0000	1.2
+++ totem-mozilla-interface.xml	9 Aug 2006 13:48:57 -0000
@@ -8,5 +8,6 @@
     <method name="SetLocalFile">
       <arg type="s"/>
     </method>
+    <signal name="StopSendingData"/>
   </interface>
 </node>
Index: totem-mozilla-plugin.cpp
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-plugin.cpp,v
retrieving revision 1.57
diff -u -p -r1.57 totem-mozilla-plugin.cpp
--- totem-mozilla-plugin.cpp	8 Aug 2006 15:47:23 -0000	1.57
+++ totem-mozilla-plugin.cpp	9 Aug 2006 13:48:57 -0000
@@ -68,6 +68,15 @@ cb_update_name (DBusGProxy *proxy, char 
 	}
 }
 
+static void
+cb_stop_sending_data (DBusGProxy  *proxy, int val, void *data)
+{
+	TotemPlugin *plugin = (TotemPlugin *) data;
+
+	g_message ("STOP SENDING DATA");
+	plugin->stop_sending_data = TRUE;
+}
+
 static gboolean
 is_supported_scheme (const char *url)
 {
@@ -216,9 +225,14 @@ totem_plugin_fork (TotemPlugin *plugin)
 	dbus_g_proxy_add_signal (plugin->proxy, "NameOwnerChanged",
 				 G_TYPE_STRING, G_TYPE_STRING,
 				 G_TYPE_STRING, G_TYPE_INVALID);
+	dbus_g_proxy_add_signal (plugin->proxy, "StopSendingData",
+				 G_TYPE_INT, G_TYPE_INVALID);
 	dbus_g_proxy_connect_signal (plugin->proxy, "NameOwnerChanged",
 				     G_CALLBACK (cb_update_name),
 				     plugin, NULL);
+	dbus_g_proxy_connect_signal (plugin->proxy, "StopSendingData",
+				     G_CALLBACK (cb_stop_sending_data),
+				     plugin, NULL);
 	g_get_current_time (&then);
 	g_time_val_add (&then, G_USEC_PER_SEC * 5);
 	NS_ADDREF (iface);
@@ -555,7 +569,7 @@ static int32 totem_plugin_write_ready (N
 	TotemPlugin *plugin;
 	struct pollfd fds;
 
-	D("plugin_write_ready");
+	//D("plugin_write_ready");
 
 	if (instance == NULL) {
 		D("plugin_write_ready instance is NULL");
@@ -567,14 +581,24 @@ static int32 totem_plugin_write_ready (N
 	if (is_supported_scheme (plugin->src) == FALSE)
 		return 0;
 
-	if (plugin->send_fd < 0)
+	if (plugin->stop_sending_data != FALSE) {
+		D("stop_sending_data != FALSE");
+		return 0;
+	}
+
+	if (plugin->send_fd < 0) {
+		D("No fd");
 		return (8 * 1024);
+	}
 
 	fds.events = POLLOUT;
 	fds.fd = plugin->send_fd;
-	if (plugin->send_fd > 0 && poll (&fds, 1, 0) > 0)
+	if (plugin->send_fd > 0 && poll (&fds, 1, 0) > 0) {
+		D("can have more data");
 		return (8 * 1024);
+	}
 
+	D("Returning nought");
 	return 0;
 }
 
Index: totem-mozilla-scriptable.h
===================================================================
RCS file: /cvs/gnome/totem/src/totem-mozilla-scriptable.h,v
retrieving revision 1.15
diff -u -p -r1.15 totem-mozilla-scriptable.h
--- totem-mozilla-scriptable.h	9 Aug 2006 12:42:25 -0000	1.15
+++ totem-mozilla-scriptable.h	9 Aug 2006 13:48:57 -0000
@@ -53,6 +53,7 @@ typedef struct {
 	gboolean hidden : 1;
 	gboolean repeat : 1;
 	gboolean is_playlist : 1;
+	gboolean stop_sending_data : 1;
 } TotemPlugin;
 
 class totemMozillaMix : public nsIClassInfo {
