On Fri, 2013-09-13 at 17:45 -0300, Jo?o Paulo Rechi Vita wrote: > On Sun, Aug 18, 2013 at 10:37 AM, Tanu Kaskinen > <tanu.kaskinen at linux.intel.com> wrote: > > On Tue, 2013-08-13 at 01:54 -0300, jprvita at gmail.com wrote: > >> From: Jo?o Paulo Rechi Vita <jprvita at openbossa.org> > >> > >> Get the remote device information stored in pa_bluetooth_discovery. This > >> also creates the mandatory parameter 'path' for module-bluez5-device, > >> which is used to inform the object path of the remote device in BlueZ on > >> the module load. > >> --- > >> src/modules/bluetooth/module-bluez5-device.c | 65 ++++++++++++++++++++++++++++ > >> 1 file changed, 65 insertions(+) > >> > >> diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c > >> index 890f7e4..c1c3477 100644 > >> --- a/src/modules/bluetooth/module-bluez5-device.c > >> +++ b/src/modules/bluetooth/module-bluez5-device.c > >> @@ -25,6 +25,7 @@ > >> #endif > >> > >> #include <pulsecore/module.h> > >> +#include <pulsecore/modargs.h> > >> > >> #include "bluez5-util.h" > >> > >> @@ -34,10 +35,74 @@ PA_MODULE_AUTHOR("Jo?o Paulo Rechi Vita"); > >> PA_MODULE_DESCRIPTION("BlueZ 5 Bluetooth audio sink and source"); > >> PA_MODULE_VERSION(PACKAGE_VERSION); > >> PA_MODULE_LOAD_ONCE(false); > >> +PA_MODULE_USAGE("path=<device object path>"); > >> + > >> +static const char* const valid_modargs[] = { > >> + "path", > >> + NULL > >> +}; > >> + > >> +struct userdata { > >> + pa_module *module; > >> + pa_core *core; > >> + pa_modargs *modargs; > > > > The modargs field is not needed in userdata. > > > > How am I supposed to free it in pa__done() then? I don't keep the > pointer to modargs anywhere else. You only need the modargs in pa__init(), so you can free it in pa__init(). -- Tanu