pulse-server: include buffered data in stream delay

The buffered data includes the extra samples used by the resampler.
This commit is contained in:
Wim Taymans 2022-03-29 17:41:14 +02:00
parent 5a9d2679ca
commit 8ec3932e97

View file

@ -1145,10 +1145,9 @@ do_process_done(struct spa_loop *loop,
int32_t avail; int32_t avail;
stream->timestamp = pd->pwt.now; stream->timestamp = pd->pwt.now;
stream->delay = pd->pwt.buffered * SPA_USEC_PER_SEC / stream->ss.rate;
if (pd->pwt.rate.denom > 0) if (pd->pwt.rate.denom > 0)
stream->delay = pd->pwt.delay * SPA_USEC_PER_SEC / pd->pwt.rate.denom; stream->delay = pd->pwt.delay * SPA_USEC_PER_SEC / pd->pwt.rate.denom;
else
stream->delay = 0;
if (stream->direction == PW_DIRECTION_OUTPUT) { if (stream->direction == PW_DIRECTION_OUTPUT) {
if (pd->quantum != stream->last_quantum) if (pd->quantum != stream->last_quantum)