Re: [pulseaudio-discuss] [PATCH v12 01/13] bluetooth: Fix usage of MTU, buffer sizes and return values of encode/decode methods

2019-07-13 Thread Pali Rohár
On Saturday 13 July 2019 10:14:22 Tanu Kaskinen wrote: > On Fri, 2019-07-05 at 15:02 +0200, Pali Rohár wrote: > > /* Run from IO thread */ > > static int a2dp_write_buffer(struct userdata *u, size_t nbytes) { > > int ret = 0; > > > > +if (PA_UNLIKELY(!nbytes)) { > > +

Re: [pulseaudio-discuss] [PATCH v12 01/13] bluetooth: Fix usage of MTU, buffer sizes and return values of encode/decode methods

2019-07-13 Thread Tanu Kaskinen
On Fri, 2019-07-05 at 15:02 +0200, Pali Rohár wrote: > /* Run from IO thread */ > static int a2dp_write_buffer(struct userdata *u, size_t nbytes) { > int ret = 0; > > +if (PA_UNLIKELY(!nbytes)) { > +u->write_index += (uint64_t) u->write_memchunk.length; > +

[pulseaudio-discuss] [PATCH v12 01/13] bluetooth: Fix usage of MTU, buffer sizes and return values of encode/decode methods

2019-07-05 Thread Pali Rohár
Add explanation why minimal bitpool value is used in SBC codec as initial bitpool value for A2DP source. Set buffer size for reading/writing from/to A2DP socket to exact link MTU value. This would ensure that A2DP codec does not produce larger packet as maximal possible size which can be sent.