[pulseaudio-discuss] [PATCH] When BT profile is changed, bt transport is released

Luiz Augusto von Dentz luiz.dentz at gmail.com
Wed Nov 2 05:40:08 PDT 2011


Hi Chanyeol,

On Wed, Nov 2, 2011 at 2:05 PM, Chan-yeol Park
<chanyeol.park at samsung.com> wrote:
> In case we change profile, we should release the previous transport
> in order to suspend headset connection.
> ---
>  src/modules/bluetooth/module-bluetooth-device.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
> index efbc144..9423a01 100644
> --- a/src/modules/bluetooth/module-bluetooth-device.c
> +++ b/src/modules/bluetooth/module-bluetooth-device.c
> @@ -2567,6 +2567,13 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
>     stop_thread(u);
>     shutdown_bt(u);
>
> +    /* release transport if exist */
> +    if (u->transport) {
> +        bt_transport_release(u);
> +        pa_xfree(u->transport);
> +        u->transport = NULL;
> +    }
> +
>     if (USE_SCO_OVER_PCM(u))
>         restore_sco_volume_callbacks(u);

This should only happen if profile is set to 'off' otherwise
init_profile->setup_bt will take care of releasing the current
transport, btw Frederic already send a patch sometime ago to fix this
problem we just didn't integrate because the 1.0 release.

-- 
Luiz Augusto von Dentz


More information about the pulseaudio-discuss mailing list