changeset 26420:754be87047dc

Have purple_media_set_output_volume handle all sinks.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sun, 22 Mar 2009 21:43:58 +0000
parents dd45432d6b69
children b2e290e76998
files libpurple/media.c
diffstat 1 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Sun Mar 22 21:27:43 2009 +0000
+++ b/libpurple/media.c	Sun Mar 22 21:43:58 2009 +0000
@@ -2322,10 +2322,27 @@
 		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);
 		}
 	}
 }