client-node: pass the ready status in the activation state

Pass the ready status to the client-node using the state array.

Don't just SPA_STATUS_HAVE_DATA on the server side but use the value
from the client.

This avoids some potential extra work when a driver sink pulls in data
with the NEED_DATA ready callback but then the server performs the
actions (tee) as if it were SPA_STATUS_HAVE_DATA.
This commit is contained in:
Wim Taymans 2023-04-26 15:56:29 +02:00
parent 989f597860
commit 5303fced50
2 changed files with 7 additions and 3 deletions

View file

@ -1105,6 +1105,8 @@ static void node_on_data_fd_events(struct spa_source *source)
if (source->rmask & SPA_IO_IN) {
uint64_t cmd;
struct pw_impl_node *node = this->impl->this.node;
struct pw_node_activation *a = node->rt.activation;
int status;
if (SPA_UNLIKELY(spa_system_eventfd_read(this->data_system,
this->data_source.fd, &cmd) < 0))
@ -1113,8 +1115,9 @@ static void node_on_data_fd_events(struct spa_source *source)
pw_log_info("(%s-%u) client missed %"PRIu64" wakeups",
node->name, node->info.id, cmd - 1);
spa_log_trace_fp(this->log, "%p: got ready", this);
spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA);
status = a->state[0].status;
spa_log_trace_fp(this->log, "%p: got ready %d", this, status);
spa_node_call_ready(&this->callbacks, status);
}
}

View file

@ -1189,8 +1189,9 @@ static int node_ready(void *d, int status)
spa_node_process(p->mix);
}
spa_system_clock_gettime(data_system, CLOCK_MONOTONIC, &ts);
a->state[0].status = status;
a->status = PW_NODE_ACTIVATION_TRIGGERED;
spa_system_clock_gettime(data_system, CLOCK_MONOTONIC, &ts);
a->signal_time = SPA_TIMESPEC_TO_NSEC(&ts);
if (SPA_UNLIKELY(spa_system_eventfd_write(data_system, data->rtwritefd, 1) < 0))