small cleanups

This commit is contained in:
Wim Taymans 2018-05-10 11:23:51 +02:00
parent 1ede97577b
commit 6d79ce2589
12 changed files with 46 additions and 72 deletions

View file

@ -44,8 +44,8 @@
#define DEFAULT_CHANNELS 2
#define DEFAULT_SAMPLE_RATE 44100
#define DEFAULT_BUFFER_SIZE 64
#define MAX_BUFFER_SIZE 2048
#define DEFAULT_BUFFER_SIZE (64 * sizeof(float))
#define MAX_BUFFER_SIZE (1024 * sizeof(float))
struct type {
struct spa_type_media_type media_type;

View file

@ -208,7 +208,7 @@ static int node_remove_port(struct spa_node *node, enum spa_direction direction,
static int clear_buffers(struct node *n, struct port *p)
{
if (p->n_buffers > 0) {
pw_log_info(NAME " %p: clear buffers %p", n, p);
pw_log_debug(NAME " %p: clear buffers %p", n, p);
p->n_buffers = 0;
spa_list_init(&p->queue);
}
@ -586,7 +586,7 @@ static int port_set_format(struct spa_node *node, struct port *p,
if (spa_format_audio_raw_parse(format, &info.info.raw, &t->format_audio) < 0)
return -EINVAL;
pw_log_info(NAME " %p: set format on port %p", n, p);
pw_log_debug(NAME " %p: set format on port %p", n, p);
n->sample_rate = info.info.raw.rate;
if (!SPA_FLAG_CHECK(p->flags, PORT_FLAG_DSP)) {

View file

@ -434,7 +434,7 @@ do_update_port(struct node *this,
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_PARAMS) {
port->have_format = false;
spa_log_info(this->log, "node %p: port %u update %d params", this, port_id, n_params);
spa_log_debug(this->log, "node %p: port %u update %d params", this, port_id, n_params);
for (i = 0; i < port->n_params; i++)
free(port->params[i]);
port->n_params = n_params;
@ -464,7 +464,7 @@ do_update_port(struct node *this,
}
if (!port->valid) {
spa_log_info(this->log, "node %p: adding port %d", this, port_id);
spa_log_debug(this->log, "node %p: adding port %d", this, port_id);
port->have_format = false;
port->valid = true;
for (i = 0; i < MAX_IO; i++)
@ -494,7 +494,7 @@ static void do_uninit_port(struct node *this, enum spa_direction direction, uint
{
struct port *port;
spa_log_info(this->log, "node %p: removing port %d", this, port_id);
spa_log_debug(this->log, "node %p: removing port %d", this, port_id);
if (direction == SPA_DIRECTION_INPUT) {
port = GET_IN_PORT(this, port_id);
@ -716,7 +716,7 @@ impl_node_port_use_buffers(struct spa_node *node,
this = SPA_CONTAINER_OF(node, struct node, node);
impl = this->impl;
spa_log_info(this->log, "node %p: use buffers %p %u", this, buffers, n_buffers);
spa_log_debug(this->log, "node %p: use buffers %p %u", this, buffers, n_buffers);
t = impl->t;
@ -931,7 +931,7 @@ client_node_update(void *data,
this->max_outputs = max_output_ports;
if (change_mask & PW_CLIENT_NODE_UPDATE_PARAMS) {
int i;
spa_log_info(this->log, "node %p: update %d params", this, n_params);
spa_log_debug(this->log, "node %p: update %d params", this, n_params);
for (i = 0; i < this->n_params; i++)
free(this->params[i]);
@ -941,7 +941,7 @@ client_node_update(void *data,
for (i = 0; i < this->n_params; i++)
this->params[i] = pw_spa_pod_copy(params[i]);
}
spa_log_info(this->log, "node %p: got node update max_in %u, max_out %u", this,
spa_log_debug(this->log, "node %p: got node update max_in %u, max_out %u", this,
this->max_inputs, this->max_outputs);
}
@ -958,7 +958,7 @@ client_node_port_update(void *data,
struct node *this = &impl->node;
bool remove;
spa_log_info(this->log, "node %p: got port update", this);
spa_log_debug(this->log, "node %p: got port update", this);
if (!CHECK_PORT_ID(this, direction, port_id))
return;

View file

@ -335,7 +335,7 @@ static int negotiate_format(struct impl *impl)
spa_pod_builder_init(&b, buffer, sizeof(buffer));
spa_log_info(this->log, "%p: negiotiate", impl);
spa_log_debug(this->log, "%p: negiotiate", impl);
state = 0;
if ((res = spa_node_port_enum_params(impl->adapter,
@ -385,7 +385,7 @@ static int negotiate_buffers(struct impl *impl)
struct spa_buffer_alloc_info info = { 0, };
void *skel;
spa_log_info(this->log, "%p: %d", impl, impl->n_buffers);
spa_log_debug(this->log, "%p: %d", impl, impl->n_buffers);
if (impl->n_buffers > 0)
return 0;
@ -593,7 +593,7 @@ impl_node_port_use_buffers(struct spa_node *node,
return res;
spa_log_info(this->log, "%p: %d %d", impl, n_buffers, port_id);
spa_log_debug(this->log, "%p: %d %d", impl, n_buffers, port_id);
if (n_buffers > 0 && impl->use_converter) {
if (port_id == 0)