From f777da9febe364bc065e9365a91537879489f7d5 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Sep 2020 17:55:31 +0200 Subject: [PATCH] stream: copy the position before doing the callback So that the callback can look at the updated queued bytes --- src/pipewire/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index c03c3b328..9016b54d1 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -807,6 +807,8 @@ again: } } + copy_position(impl, impl->queued.outcount); + if (!impl->draining && !SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER) && spa_ringbuffer_get_read_index(&impl->dequeued.ring, &index) > 0) { @@ -815,7 +817,6 @@ again: io->status == SPA_STATUS_NEED_DATA) goto again; } - copy_position(impl, impl->queued.outcount); pw_log_trace(NAME" %p: res %d", stream, res);