mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
sco-sink: adjust data flush timeout for msbc according to packet size
Instead of using a hardcoded value for the minimum delay between writes, select it according to the mtu/packet size that is currently used. This is necessary for correct playback with lower mtu values.
This commit is contained in:
parent
4144427655
commit
f1d9b2317c
1 changed files with 6 additions and 2 deletions
|
|
@ -401,8 +401,12 @@ next_write:
|
|||
processed = written;
|
||||
|
||||
next_timeout = get_next_timeout(this, now_time, processed / port->frame_size);
|
||||
if (this->transport->codec == HFP_AUDIO_CODEC_MSBC && next_timeout < 7500000)
|
||||
next_timeout = 7500000;
|
||||
|
||||
if (this->transport->codec == HFP_AUDIO_CODEC_MSBC) {
|
||||
uint64_t min_delay = (this->transport->write_mtu / port->frame_size
|
||||
* SPA_NSEC_PER_SEC / port->current_format.info.raw.rate);
|
||||
next_timeout = SPA_MAX(next_timeout, min_delay);
|
||||
}
|
||||
|
||||
if (this->clock) {
|
||||
this->clock->nsec = now_time;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue