# HG changeset patch # User maiku@pidgin.im # Date 1256679131 0 # Node ID bd6279df50de00c227ee5cd128d61accd2bccb5d # Parent 0761fc41bbe3e40361dacf9b9bb565948e811ac8 Move mute functionality into the Fs2 media backend. diff -r 0761fc41bbe3 -r bd6279df50de libpurple/media/backend-fs2.c --- a/libpurple/media/backend-fs2.c Tue Oct 27 21:18:41 2009 +0000 +++ b/libpurple/media/backend-fs2.c Tue Oct 27 21:32:11 2009 +0000 @@ -1121,6 +1121,36 @@ 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); diff -r 0761fc41bbe3 -r bd6279df50de libpurple/media/media.c --- a/libpurple/media/media.c Tue Oct 27 21:18:41 2009 +0000 +++ b/libpurple/media/media.c Tue Oct 27 21:32:11 2009 +0000 @@ -716,37 +716,6 @@ 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],