From 396265b9bf41b6331833a1938eb3e065e5928fe5 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 19 Apr 2011 15:59:35 +0200 Subject: media-keys: React to stream-removed signal from GvcMixerControl --- plugins/media-keys/msd-media-keys-manager.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); -- cgit v1.2.1