On Sunday 13 January 2019 18:23:20 Pali Rohár wrote: > This codec is bi-directional, therefore both sink and source directions may > be present in configuration at same time. > > Some Creative headsets send more frequency bits in configuration and when > both 41kHz and 48kHz are present then headset expects 48kHz. So adjust > FastStream frequency table as find_value_bit() takes first matched bit. > --- > monitor/a2dp.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) Hello, can somebody review this bluez patch? > diff --git a/monitor/a2dp.c b/monitor/a2dp.c > index ffdcbb962..42fe395a1 100644 > --- a/monitor/a2dp.c > +++ b/monitor/a2dp.c > @@ -201,8 +201,10 @@ static const struct bit_desc faststream_direction_table[] = { > }; > > static const struct bit_desc faststream_sink_frequency_table[] = { > - { 1, "44100" }, > + /* in config buffer, there may be more frequency bits > + * and 48kHz takes precedence over 41kHz */ > { 0, "48000" }, > + { 1, "44100" }, > { } > }; > > @@ -746,9 +748,9 @@ static bool codec_vendor_faststream_cfg(uint8_t losc, struct l2cap_frame *frame) > > l2cap_frame_get_u8(frame, &cap); > > - print_field("%*cDirection: %s (0x%02x)", BASE_INDENT + 2, ' ', > - find_value_bit(cap, faststream_direction_table), > - cap); > + /* FastStream codec is bi-directional */ > + print_field("%*cDirection: 0x%02x", BASE_INDENT + 2, ' ', cap); > + print_value_bits(BASE_INDENT + 2, cap, faststream_direction_table); > > l2cap_frame_get_u8(frame, &cap); > -- Pali Rohár pali.rohar@xxxxxxxxx
Attachment:
signature.asc
Description: PGP signature