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

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

 



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

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss




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

  Powered by Linux