Commit a4e690bd authored by Igor Kovalenko's avatar Igor Kovalenko Committed by PulseAudio Marge Bot
Browse files

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: <!695>
parent a4402bb4
Pipeline #587757 passed with stages
in 1 minute and 35 seconds
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment