[PATCH next v0 06/10] bluetooth: Use transport state to update port availability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-12-12 at 13:17 +0100, Mikel Astiz wrote:
>  /* Run from main thread */
> -static void handle_profile_state_change(struct userdata *u, enum profile profile, pa_bt_audio_state_t state) {
> +static void handle_transport_state_change(struct userdata *u, struct pa_bluetooth_transport *transport) {
>      bool acquire = FALSE;
>      bool release = FALSE;
> +    enum profile profile;
> +    pa_bluetooth_transport_state_t state;
>  
>      pa_assert(u);
> -    pa_assert(state != PA_BT_AUDIO_STATE_INVALID);
> +    pa_assert(transport);
> +
> +    profile = transport->profile;
> +    state = transport->state;
> +
> +    pa_log_debug("profile=%s, transport=%s, new_state=%d", profile_to_string(profile), transport->path, state);

Instead of printing the new state in the hook user code (of which there
may be multiple occurrences), it would be better to print it in the code
that fires the hook.

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux