From c9a6a27aa766b31d9f32d182b1de5886793e906b Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 19 Apr 2011 13:59:35 +0000 Subject: media-keys: React to stream-removed signal from GvcMixerControl --- diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c index b563f73..1f18074 100644 --- a/plugins/media-keys/gsd-media-keys-manager.c +++ b/plugins/media-keys/gsd-media-keys-manager.c @@ -794,6 +794,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 @@ -1118,6 +1131,10 @@ gsd_media_keys_manager_start (GsdMediaKeysManager *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 v0.9