pidgin.vv: a0f0b394: Have purple_media_set_output_volume hand...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sun Mar 22 23:01:22 EDT 2009


-----------------------------------------------------------------
Revision: a0f0b3949ad425ea60cdeec2a93016c7b4c1f341
Ancestor: 4a50d85882916682be05dd26cd0c5c6803604ef0
Author: maiku at soc.pidgin.im
Date: 2009-03-22T21:43:58
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a0f0b3949ad425ea60cdeec2a93016c7b4c1f341

Modified files:
        libpurple/media.c

ChangeLog: 

Have purple_media_set_output_volume handle all sinks.

-------------- next part --------------
============================================================
--- libpurple/media.c	ec6191518baf894b88c8ccbc4916cb106d55c393
+++ libpurple/media.c	01dfc80fa11fecb9cfe802a71c307957163dd0f1
@@ -2322,10 +2322,27 @@ void purple_media_set_output_volume(Purp
 		PurpleMediaStream *stream = streams->data;
 
 		if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO) {
-			GstElement *volume = gst_bin_get_by_name(
-					GST_BIN(stream->sink),
-					"purpleaudiooutputvolume");
-			g_object_set(volume, "volume", level, NULL);
+			GstElement *tee = stream->tee;
+			GstIterator *iter = gst_element_iterate_src_pads(tee);
+			GstPad *sinkpad;
+			while (gst_iterator_next(iter, (gpointer)&sinkpad)
+					 == GST_ITERATOR_OK) {
+				GstPad *peer = gst_pad_get_peer(sinkpad);
+				GstElement *volume;
+
+				if (peer == NULL) {
+					gst_object_unref(sinkpad);
+					continue;
+				}
+					
+				volume = gst_bin_get_by_name(GST_BIN(
+						GST_OBJECT_PARENT(peer)),
+						"purpleaudiooutputvolume");
+				g_object_set(volume, "volume", level, NULL);
+				gst_object_unref(peer);
+				gst_object_unref(sinkpad);
+			}
+			gst_iterator_free(iter);
 		}
 	}
 }


More information about the Commits mailing list