stream: copy position before going to STREAMING

So that get_time_n will return values as soon as we go to STREAMING.

Fixes #3995
This commit is contained in:
Wim Taymans 2024-05-03 11:53:15 +02:00
parent 88e9f7683c
commit f73d3e4af9

View file

@ -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;