pidgin.vv: f98d4128: Fix audio levels.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Fri Mar 20 04:35:59 EDT 2009


-----------------------------------------------------------------
Revision: f98d41285fc5ad6a52b4d745b64c48077587732b
Ancestor: fcf00cb2ec06f9929b2660855ffe5f4ec6cc87be
Author: maiku at soc.pidgin.im
Date: 2009-03-20T08:10:26
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/f98d41285fc5ad6a52b4d745b64c48077587732b

Modified files:
        libpurple/media.c pidgin/gtkmedia.c

ChangeLog: 

Fix audio levels.

-------------- next part --------------
============================================================
--- libpurple/media.c	09961d087845dc11c24b6371a731bb659aeaf8b6
+++ libpurple/media.c	7a66ee2ab066eae2b3f945c855292c6717ed904e
@@ -1770,6 +1770,7 @@ purple_media_src_pad_added_cb(FsStream *
 					"liveadder", NULL);
 			sink = purple_media_manager_get_element(priv->manager,
 					PURPLE_MEDIA_RECV_AUDIO);
+			stream->sink = sink;
 		} else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) {
 			stream->src = gst_element_factory_make(
 					"fsfunnel", NULL);
============================================================
--- pidgin/gtkmedia.c	49bd9459855c67e7744e64c135843373770a3249
+++ pidgin/gtkmedia.c	1b87ee1698c4447cb2ce472ed42429e6bdbdcf56
@@ -324,7 +324,7 @@ level_message_cb(GstBus *bus, GstMessage
 	if (message->type != GST_MESSAGE_ELEMENT)
 		return TRUE;
 
-	if (gst_structure_has_name(
+	if (!gst_structure_has_name(
 			gst_message_get_structure(message), "level"))
 		return TRUE;
 
@@ -612,6 +612,10 @@ pidgin_media_ready_cb(PurpleMedia *media
 		gtk_widget_show(gtkmedia->priv->recv_progress);
 	}
 	if (type & PURPLE_MEDIA_SEND_AUDIO) {
+		GstElement *media_src = purple_media_get_src(media, sid);
+		gtkmedia->priv->send_level = gst_bin_get_by_name(
+				GST_BIN(media_src), "sendlevel");
+
 		gtkmedia->priv->send_progress = gtk_progress_bar_new();
 		gtk_widget_set_size_request(gtkmedia->priv->send_progress, 320, 10);
 		gtk_box_pack_end(GTK_BOX(send_widget),
@@ -675,6 +679,13 @@ pidgin_media_state_changed_cb(PurpleMedi
 	} else if (type == PURPLE_MEDIA_STATE_CHANGED_NEW &&
 			sid != NULL && name != NULL) {
 		pidgin_media_ready_cb(media, gtkmedia, sid);
+	} else if (type == PURPLE_MEDIA_STATE_CHANGED_CONNECTED &&
+			purple_media_get_session_type(media, sid) &
+			PURPLE_MEDIA_RECV_AUDIO) {
+		GstElement *media_sink = purple_media_get_sink(media,
+				sid, name);
+		gtkmedia->priv->recv_level = gst_bin_get_by_name(
+				GST_BIN(media_sink), "recvlevel");
 	}
 }
 


More information about the Commits mailing list