mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
bluetooth: Make sure there is at least one SBC frame to encode
If SBC frame plus RTP header exceeds MTU size, let block size be at least one frame to make sure bluetooth code can make progress reading and writing data. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/695>
This commit is contained in:
parent
a4402bb4f4
commit
a4e690bda5
1 changed files with 8 additions and 0 deletions
|
|
@ -731,6 +731,14 @@ static size_t get_block_size(void *codec_info, size_t link_mtu) {
|
|||
if (frame_count > 15)
|
||||
frame_count = 15;
|
||||
|
||||
/* Code dealing with read/write block size expects it to be
|
||||
* non-zero to make progress, make it at least one frame.
|
||||
*/
|
||||
if (frame_count < 1) {
|
||||
pa_log_warn("SBC packet size %lu is larger than link MTU %lu", sbc_info->frame_length + rtp_size, link_mtu);
|
||||
frame_count = 1;
|
||||
}
|
||||
|
||||
return frame_count * sbc_info->codesize;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue