summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index d7e1b04..e7310c6 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -862,6 +862,19 @@ on_control_default_sink_changed (GvcMixerControl *control,
update_default_sink (manager);
}
+static void
+on_control_stream_removed (GvcMixerControl *control,
+ guint id,
+ GsdMediaKeysManager *manager)
+{
+ if (manager->priv->stream != NULL) {
+ if (gvc_mixer_stream_get_id (manager->priv->stream) == id) {
+ g_object_unref (manager->priv->stream);
+ manager->priv->stream = NULL;
+ }
+ }
+}
+
#endif /* HAVE_PULSE */
static gint
@@ -1186,6 +1199,10 @@ msd_media_keys_manager_start (MsdMediaKeysManager *manager,
"default-sink-changed",
G_CALLBACK (on_control_default_sink_changed),
manager);
+ g_signal_connect (manager->priv->volume,
+ "stream-removed",
+ G_CALLBACK (on_control_stream_removed),
+ manager);
gvc_mixer_control_open (manager->priv->volume);