[pulseaudio-discuss] [PATCH v2] bluetooth: Only create backend instance once objects are listed

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Wed Sep 10 03:22:57 PDT 2014


On Wed, 2014-09-10 at 13:02 +0300, Luiz Augusto von Dentz wrote:
> Hi Tanu,
> 
> On Mon, Sep 8, 2014 at 1:35 PM, Luiz Augusto von Dentz
> <luiz.dentz at gmail.com> wrote:
> > From: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>
> >
> > This makes sure the devices are discovered before the backend start
> > creating new transports.
> > ---
> >  src/modules/bluetooth/bluez5-util.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
> > index efe87d3..97862d5 100644
> > --- a/src/modules/bluetooth/bluez5-util.c
> > +++ b/src/modules/bluetooth/bluez5-util.c
> > @@ -895,6 +895,9 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *userdata)
> >
> >      y->objects_listed = true;
> >
> > +    if (!y->backend)
> > +        y->backend = pa_bluetooth_backend_new(y->core);
> > +
> >  finish:
> >      dbus_message_unref(r);
> >
> > @@ -947,6 +950,10 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
> >                  pa_hashmap_remove_all(y->devices);
> >                  pa_hashmap_remove_all(y->adapters);
> >                  y->objects_listed = false;
> > +                if (y->backend) {
> > +                    pa_bluetooth_backend_free(y->backend);
> > +                    y->backend = NULL;
> > +                }
> >              }
> >
> >              if (new_owner && *new_owner) {
> > @@ -1597,7 +1604,6 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
> >
> >      endpoint_init(y, PA_BLUETOOTH_PROFILE_A2DP_SINK);
> >      endpoint_init(y, PA_BLUETOOTH_PROFILE_A2DP_SOURCE);
> > -    y->backend = pa_bluetooth_backend_new(c);
> >
> >      get_managed_objects(y);
> >
> > --
> > 1.9.3
> 
> I guess this one is fine to apply now that I covered your comments.

Yes, sorry for not applying it immediately. I somehow missed this patch,
even though it was marked as read in my mailbox.

Did you have a look on the "bluetooth: Move stuff to
pa_transport_put/unlink()" patch? Does it make sense to you?

-- 
Tanu



More information about the pulseaudio-discuss mailing list