From b952cfbe387788f469c9ad9af1619d50cccb0ea9 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Mon, 13 Jan 2025 18:31:43 +0200 Subject: [PATCH] bluez5: remove resampler delay fudge factor The resampler delay was off by one sample, so remove the corresponding fudge factor here. This matters for BAP output synchronization. The resampler has also some fractional delay, so there can still be sub-sample offset between the original and resampled timelines. This is not currently taken into account. --- spa/plugins/bluez5/media-sink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/spa/plugins/bluez5/media-sink.c b/spa/plugins/bluez5/media-sink.c index b32b1bf21..028547b51 100644 --- a/spa/plugins/bluez5/media-sink.c +++ b/spa/plugins/bluez5/media-sink.c @@ -544,7 +544,6 @@ static uint64_t get_reference_time(struct impl *this, uint64_t *duration_ns_ret) if (port->rate_match && this->position && resampling) { t -= (uint64_t)port->rate_match->delay * SPA_NSEC_PER_SEC / this->position->clock.rate.denom; - t += SPA_NSEC_PER_SEC / port->current_format.info.raw.rate; } return t;