bluetooth: produce silence on mSBC decoding error

We are supposed to conceal packet loss. This is not trivial but we can at least
produce silence instead of breaking on mSBC decoding error.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/507>
This commit is contained in:
Igor V. Kovalenko 2021-02-26 00:00:47 +03:00 committed by PulseAudio Marge Bot
parent 436813d8a8
commit 436a98a50b

View file

@ -287,9 +287,11 @@ static size_t decode_buffer(void *codec_info, const uint8_t *input_buffer, size_
if (PA_UNLIKELY(decoded <= 0)) {
pa_log_error("mSBC decoding error (%li)", (long) decoded);
*processed = 0;
return 0;
pa_silence_memory(output_buffer, sbc_info->codesize, &sbc_info->sample_spec);
decoded = sbc_info->frame_length;
written = sbc_info->codesize;
}
pa_assert_fp((size_t)decoded == sbc_info->frame_length);
pa_assert_fp((size_t)written == sbc_info->codesize);