Small cleanups

This commit is contained in:
Wim Taymans 2017-10-16 18:09:59 +02:00
parent 574c6d4b90
commit ce6b75cf63
7 changed files with 8 additions and 18 deletions

View file

@ -48,7 +48,8 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
if (pnode->ready_link.next == NULL)
spa_list_append(&ready, &pnode->ready_link);
}
else if (pport->io->status == SPA_RESULT_OK && !(pnode->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
else if (pport->io->status == SPA_RESULT_OK &&
!(pnode->flags & SPA_GRAPH_NODE_FLAG_ASYNC))
node->ready[SPA_DIRECTION_INPUT]++;
}
@ -69,7 +70,8 @@ static inline int spa_graph_impl_need_input(void *data, struct spa_graph_node *n
spa_debug("node %p ready:%d required:%d", node, node->ready[SPA_DIRECTION_INPUT], node->required[SPA_DIRECTION_INPUT]);
if (node->required[SPA_DIRECTION_INPUT] > 0 && node->ready[SPA_DIRECTION_INPUT] == node->required[SPA_DIRECTION_INPUT]) {
if (node->required[SPA_DIRECTION_INPUT] > 0 &&
node->ready[SPA_DIRECTION_INPUT] == node->required[SPA_DIRECTION_INPUT]) {
node->state = spa_node_process_input(node->implementation);
spa_debug("node %p processed in %d", node, node->state);
if (node->state == SPA_RESULT_HAVE_BUFFER) {

View file

@ -636,12 +636,6 @@ static struct spa_buffer *find_free_buffer(struct impl *this, struct port *port)
return b->outbuf;
}
static inline void release_buffer(struct impl *this, struct spa_buffer *buffer)
{
if (this->callbacks && this->callbacks->reuse_buffer)
this->callbacks->reuse_buffer(this->callbacks_data, 0, buffer->id);
}
static void do_volume(struct impl *this, struct spa_buffer *dbuf, struct spa_buffer *sbuf)
{
uint32_t si, di, i, n_samples, n_bytes, soff, doff;
@ -703,7 +697,6 @@ static int impl_node_process_input(struct spa_node *node)
if (output->status == SPA_RESULT_HAVE_BUFFER)
return SPA_RESULT_HAVE_BUFFER;
in_port = &this->in_ports[0];
input = in_port->io;
spa_return_val_if_fail(input != NULL, SPA_RESULT_ERROR);

View file

@ -809,6 +809,7 @@ static int spa_proxy_node_process_output(struct spa_node *node)
pw_client_node_transport_add_message(impl->transport,
&PW_CLIENT_NODE_MESSAGE_INIT(PW_CLIENT_NODE_MESSAGE_PROCESS_OUTPUT));
do_flush(this);
return res;
}
@ -848,7 +849,6 @@ client_node_done(void *data, int seq, int res)
this->callbacks->done(this->callbacks_data, seq, res);
}
static void
client_node_update(void *data,
uint32_t change_mask,

View file

@ -1080,7 +1080,6 @@ struct pw_link *pw_link_new(struct pw_core *core,
this->properties = properties;
this->state = PW_LINK_STATE_INIT;
this->input = input;
this->output = output;

View file

@ -476,6 +476,7 @@ static void node_event(void *data, struct spa_event *event)
static void node_need_input(void *data)
{
struct pw_node *node = data;
pw_log_trace("node %p: need input", node);
spa_hook_list_call(&node->listener_list, struct pw_node_events, need_input);
spa_graph_need_input(node->rt.graph, &node->rt.node);
}
@ -483,6 +484,7 @@ static void node_need_input(void *data)
static void node_have_output(void *data)
{
struct pw_node *node = data;
pw_log_trace("node %p: have output", node);
spa_graph_have_output(node->rt.graph, &node->rt.node);
spa_hook_list_call(&node->listener_list, struct pw_node_events, have_output);
}

View file

@ -96,7 +96,6 @@ struct stream {
bool in_order;
bool client_reuse;
uint32_t *last_buffer_id;
struct spa_list free;
bool in_need_buffer;
@ -906,12 +905,9 @@ static void client_node_transport(void *data, uint32_t node_id,
if (impl->trans) {
pw_client_node_transport_destroy(impl->trans);
free (impl->last_buffer_id);
}
impl->trans = transport;
impl->last_buffer_id = malloc(impl->trans->area->max_input_ports * sizeof(uint32_t));
for (i = 0; i < impl->trans->area->max_input_ports; i++) {
impl->last_buffer_id[i] = SPA_ID_INVALID;
}
pw_log_info("stream %p: create client transport %p with fds %d %d for node %u",
@ -1042,8 +1038,6 @@ void pw_stream_disconnect(struct pw_stream *stream)
if (impl->trans) {
pw_client_node_transport_destroy(impl->trans);
impl->trans = NULL;
free(impl->last_buffer_id);
impl->last_buffer_id = NULL;
}
}

View file

@ -843,7 +843,7 @@ static bool do_info(struct data *data, const char *cmd, char *args, char **error
n = pw_split_ip(args, WHITESPACE, 1, a);
if (n < 1) {
asprintf(error, "%s <object-id>", cmd);
asprintf(error, "%s <object-id>|all", cmd);
return false;
}
if (!strcmp(a[0], "all")) {