[pulseaudio-discuss] [PATCH v12 02/13] bluetooth: Change A2DP codec API of reset() method to indicate failure

Tanu Kaskinen tanuk at iki.fi
Thu Jul 18 06:00:07 UTC 2019


On Fri, 2019-07-05 at 15:02 +0200, Pali Rohár wrote:
>  /* Run from I/O thread */
> -static void setup_stream(struct userdata *u) {
> +static bool setup_stream(struct userdata *u) {
>      struct pollfd *pollfd;
>      int one;
>  
>      /* return if stream is already set up */
>      if (u->stream_setup_done)
> -        return;
> +        return true;
>  
>      pa_log_info("Transport %s resuming", u->transport->path);
>  
>      if (u->profile == PA_BLUETOOTH_PROFILE_A2DP_SINK) {
>          pa_assert(u->a2dp_codec);
> -        u->a2dp_codec->reset(u->encoder_info);
> +        if (u->a2dp_codec->reset(u->encoder_info) != 0)
> +            return false;
>      } else if (u->profile == PA_BLUETOOTH_PROFILE_A2DP_SOURCE) {
>          pa_assert(u->a2dp_codec);
> -        u->a2dp_codec->reset(u->decoder_info);
> +        if (u->a2dp_codec->reset(u->decoder_info) != 0)

"< 0" is the usual convention rather than "!= 0".

(Sorry for this extra mail, I originally wrote this in the first review
mail, but it seems that before sending it, I trimmed too much from the
bottom of the email and accidentally deleted this bit.)

-- 
Tanu

https://www.patreon.com/tanuk
https://liberapay.com/tanuk



More information about the pulseaudio-discuss mailing list