cpw.maiku.media_refactor: 34b6c979: Move mute functionality into the Fs2 med...

maiku at pidgin.im maiku at pidgin.im
Tue Oct 27 20:27:37 EDT 2009


-----------------------------------------------------------------
Revision: 34b6c9794d81abe1c27d0d092e1cf0377a84aafa
Ancestor: d240ad16015e43359cd469084779f39dd263ca2d
Author: maiku at pidgin.im
Date: 2009-10-27T21:32:11
Branch: im.pidgin.cpw.maiku.media_refactor
URL: http://d.pidgin.im/viewmtn/revision/info/34b6c9794d81abe1c27d0d092e1cf0377a84aafa

Modified files:
        libpurple/media/backend-fs2.c libpurple/media/media.c

ChangeLog: 

Move mute functionality into the Fs2 media backend.

-------------- next part --------------
============================================================
--- libpurple/media/backend-fs2.c	65d2902cc138f51b0fd732b0f7a368eeaa39b426
+++ libpurple/media/backend-fs2.c	c3e1a42ab363bcbd0f1df58b5f2a1b498d11fa33
@@ -1121,6 +1121,36 @@ _stream_info_cb(PurpleMedia *media, Purp
 					err->message);
 			g_error_free(err);
 		}
+	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE ||
+			type == PURPLE_MEDIA_INFO_UNMUTE)) {
+		PurpleMediaBackendFs2Private *priv =
+				PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self);
+		gboolean active = (type == PURPLE_MEDIA_INFO_MUTE);
+		GList *sessions;
+
+		if (sid == NULL)
+			sessions = g_hash_table_get_values(priv->sessions);
+		else
+			sessions = g_list_prepend(NULL,
+					_get_session(self, sid));
+
+		purple_debug_info("media", "Turning mute %s\n",
+				active ? "on" : "off");
+
+		for (; sessions; sessions = g_list_delete_link(
+				sessions, sessions)) {
+			PurpleMediaBackendFs2Session *session =
+					sessions->data;
+
+			if (session->type & PURPLE_MEDIA_SEND_AUDIO) {
+				gchar *name = g_strdup_printf("volume_%s",
+						session->id);
+				GstElement *volume = gst_bin_get_by_name(
+						GST_BIN(priv->confbin), name);
+				g_free(name);
+				g_object_set(volume, "mute", active, NULL);
+			}
+		}
 	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_PAUSE ||
 			type == PURPLE_MEDIA_INFO_UNPAUSE)) {
 		gboolean active = (type == PURPLE_MEDIA_INFO_PAUSE);
============================================================
--- libpurple/media/media.c	aefcc4103c04bf4c4fdca8842235ab64495d921b
+++ libpurple/media/media.c	acb92c5064026901408f4088d3efc5bae1d4df21
@@ -716,37 +716,6 @@ purple_media_stream_info(PurpleMedia *me
 
 			stream->accepted = TRUE;
 		}
-	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE ||
-			type == PURPLE_MEDIA_INFO_UNMUTE)) {
-		GList *sessions;
-		gboolean active = (type == PURPLE_MEDIA_INFO_MUTE);
-
-		g_return_if_fail(PURPLE_IS_MEDIA(media));
-
-		if (session_id == NULL)
-			sessions = g_hash_table_get_values(
-					media->priv->sessions);
-		else
-			sessions = g_list_prepend(NULL,
-					purple_media_get_session(
-					media, session_id));
-
-		purple_debug_info("media", "Turning mute %s\n",
-				active ? "on" : "off");
-
-		for (; sessions; sessions = g_list_delete_link(
-				sessions, sessions)) {
-			PurpleMediaSession *session = sessions->data;
-			if (session->type & PURPLE_MEDIA_SEND_AUDIO) {
-				gchar *name = g_strdup_printf("volume_%s",
-						session->id);
-				GstElement *volume = gst_bin_get_by_name(
-						GST_BIN(session->media->
-						priv->confbin), name);
-				g_free(name);
-				g_object_set(volume, "mute", active, NULL);
-			}
-		}
 	}
 
 	g_signal_emit(media, purple_media_signals[STREAM_INFO],


More information about the Commits mailing list