mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-15 05:34:03 -04:00
bluez5: account for codec internal delay in latency values
Encoders and some decoders have additional internal latency that needs to be accounted for. This mostly matters for AAC (~40ms), as the other BT codecs have much lower delays (~5ms).
This commit is contained in:
parent
1b3b577b8f
commit
2d30ab94c2
10 changed files with 151 additions and 10 deletions
|
|
@ -1560,6 +1560,12 @@ static void process_buffering(struct impl *this)
|
|||
|
||||
if (this->update_delay_event) {
|
||||
int32_t target = spa_bt_decode_buffer_get_target_latency(&port->buffer);
|
||||
uint32_t decoder_delay = 0;
|
||||
|
||||
if (this->codec->get_delay)
|
||||
this->codec->get_delay(this->codec_data, NULL, &decoder_delay);
|
||||
|
||||
target += decoder_delay;
|
||||
|
||||
if (target != this->delay.buffer || duration != this->delay.duration) {
|
||||
struct delay_info info = { .buffer = target, .duration = duration };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue