summaryrefslogtreecommitdiff
path: root/libbanshee/banshee-player-pipeline.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbanshee/banshee-player-pipeline.c')
-rw-r--r--libbanshee/banshee-player-pipeline.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libbanshee/banshee-player-pipeline.c b/libbanshee/banshee-player-pipeline.c
index c95208f90..773f568fd 100644
--- a/libbanshee/banshee-player-pipeline.c
+++ b/libbanshee/banshee-player-pipeline.c
@@ -330,6 +330,21 @@ _bp_pipeline_construct (BansheePlayer *player)
}
g_return_val_if_fail (audiosink != NULL, FALSE);
+
+ // See if the audiosink has a 'volume' property. If it does, we assume it saves and restores
+ // its volume information - and that we shouldn't
+ player->audiosink_has_volume = FALSE;
+ if (!GST_IS_BIN (audiosink)) {
+ player->audiosink_has_volume = g_object_class_find_property (G_OBJECT_GET_CLASS (audiosink), "volume") != NULL;
+ } else {
+ GstIterator *elem_iter = gst_bin_iterate_recurse (GST_BIN (audiosink));
+ BANSHEE_GST_ITERATOR_ITERATE (elem_iter, GstElement *, element, TRUE, {
+ player->audiosink_has_volume |= g_object_class_find_property (G_OBJECT_GET_CLASS (element), "volume") != NULL;
+ gst_object_unref (element);
+ });
+ }
+ bp_debug ("Audiosink has volume: %s",
+ player->audiosink_has_volume ? "YES" : "NO");
// Set the profile to "music and movies" (gst-plugins-good 0.10.3)
if (g_object_class_find_property (G_OBJECT_GET_CLASS (audiosink), "profile")) {