]> code.delx.au - pulseaudio/commit
bluetooth: Ignore Device.DisconnectRequested
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 28 Sep 2012 15:45:26 +0000 (17:45 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Sun, 14 Oct 2012 16:16:21 +0000 (19:16 +0300)
commit67c00905560fbdecaa6bc07d6e1416155d65881b
tree48c95d24b3147fad6a83243cd06205aa49369e98
parentf0432ce6aedca5956f6086824120bb03559e6534
bluetooth: Ignore Device.DisconnectRequested

Handling the signal DisconnectRequested should be unnecessary since the
profile-specific interfaces will be later disconnected, leading to
module unload.

Additionally, the signal is problematic: if an interface (i.e.
A2DP AudioSource) is playing at the time DisconnectRequested is
signaled, the following sequence can occur:

1. AudioSource is playing
2. DisconnectRequested is received
3. Module is unloaded due to DisconnectRequested
4. AudioSource state changes from playing to connected
5. module-bluetooth-discover loads the module
6. AudioSource state changes from connected to disconnected

Therefore the module is unnecessarily loaded, to be unloaded immediately
afterwards. This can easily be reproduced if a device is unpaired while
the audio is streaming.

The simplest solution to this consists of removing step 3, by just
ignoring the DisconnectRequested signal. This reverts commit
8169a6a6c921215c1353e8a34fccbdc4e2e20440.
src/modules/bluetooth/bluetooth-util.c