From f73d3e4af9092d3c434a5fd1937a8521bd91a4c4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 3 May 2024 11:53:15 +0200 Subject: [PATCH] stream: copy position before going to STREAMING So that get_time_n will return values as soon as we go to STREAMING. Fixes #3995 --- 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 29bc5468d..306105f7f 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -665,12 +665,13 @@ static int impl_send_command(void *object, const struct spa_command *command) break; case SPA_NODE_COMMAND_Start: if (stream->state == PW_STREAM_STATE_PAUSED) { - pw_log_debug("%p: start %d", stream, impl->direction); + pw_log_debug("%p: start direction:%d", stream, impl->direction); if (impl->direction == SPA_DIRECTION_INPUT) { if (impl->io != NULL) impl->io->status = SPA_STATUS_NEED_DATA; } + copy_position(impl, impl->queued.incount); stream_set_state(stream, PW_STREAM_STATE_STREAMING, 0, NULL); } break;