summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/headset.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c
index a4fe84fe..a0b7af54 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1899,6 +1899,12 @@ static void headset_free(struct audio_device *dev)
static void path_unregister(void *data)
{
struct audio_device *dev = data;
+ struct headset *hs = dev->headset;
+
+ if (hs->state > HEADSET_STATE_DISCONNECTED) {
+ debug("Headset unregistered while device was connected!");
+ headset_set_state(hs, HEADSET_STATE_DISCONNECTED);
+ }
info("Unregistered interface %s on path %s",
AUDIO_HEADSET_INTERFACE, dev->path);