[pulseaudio-discuss] [PATCH 5/5] bluetooth: Set device_info_valid to -1 when the device's adapter disappears

João Paulo Rechi Vita jprvita at gmail.com
Tue Oct 1 07:04:44 PDT 2013


On Sun, Sep 29, 2013 at 12:49 PM, Tanu Kaskinen
<tanu.kaskinen at linux.intel.com> wrote:
> When parsing device properties, missing adapter will result in
> device_info_valid being set to -1. It is then logical that if the
> adapter goes missing at a later point, device_info_valid gets set to
> -1.
> ---
>  src/modules/bluetooth/bluez5-util.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
> index 591ea50..3408b2c 100644
> --- a/src/modules/bluetooth/bluez5-util.c
> +++ b/src/modules/bluetooth/bluez5-util.c
> @@ -477,8 +477,10 @@ static void adapter_free(pa_bluetooth_adapter *a) {
>      pa_assert(a->discovery);
>
>      PA_HASHMAP_FOREACH(d, a->discovery->devices, state)
> -        if (d->adapter == a)
> +        if (d->adapter == a) {
> +            set_device_info_valid(d, -1);
>              d->adapter = NULL;
> +        }
>
>      pa_xfree(a->path);
>      pa_xfree(a->address);

Ack.

-- 
João Paulo Rechi Vita
http://about.me/jprvita


More information about the pulseaudio-discuss mailing list