diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-01-07 18:14:04 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-01-07 18:14:04 +0100 |
commit | b95584c3126655a458c16b6c4ac01ddfcc7f1b6c (patch) | |
tree | f6628ee8d4e9aa988d44c83c492bafd912b5abcc | |
parent | 44cb131269b476992f7448057b464dcff34a3de3 (diff) |
plugins: fix warnings
-rw-r--r-- | spa/plugins/audiomixer/audiomixer.c | 22 | ||||
-rw-r--r-- | spa/plugins/test/fakesink.c | 6 | ||||
-rw-r--r-- | spa/plugins/test/fakesrc.c | 6 | ||||
-rw-r--r-- | spa/plugins/videotestsrc/videotestsrc.c | 7 | ||||
-rw-r--r-- | spa/plugins/volume/volume.c | 2 |
5 files changed, 27 insertions, 16 deletions
diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index f7f622c4..2f26cfd2 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -56,6 +56,7 @@ static void port_props_reset(struct port_props *props) } struct buffer { + uint32_t id; struct spa_list link; bool outstanding; @@ -97,8 +98,8 @@ struct impl { const struct spa_node_callbacks *callbacks; void *user_data; - int port_count; - int last_port; + uint32_t port_count; + uint32_t last_port; struct port in_ports[MAX_PORTS]; struct port out_ports[1]; @@ -216,7 +217,7 @@ impl_node_get_port_ids(struct spa_node *node, uint32_t n_output_ids) { struct impl *this; - int i, idx; + uint32_t i, idx; spa_return_val_if_fail(node != NULL, -EINVAL); @@ -625,6 +626,7 @@ impl_node_port_use_buffers(struct spa_node *node, struct spa_data *d = buffers[i]->datas; b = &port->buffers[i]; + b->id = i; b->outbuf = buffers[i]; b->outstanding = (direction == SPA_DIRECTION_INPUT); b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); @@ -780,20 +782,20 @@ add_port_data(struct impl *this, void *out, size_t outsize, struct port *port, i if (port->queued_bytes == 0) { spa_log_trace(this->log, NAME " %p: return buffer %d on port %d %zd", - this, b->outbuf->id, port->id, outsize); - port->io->buffer_id = b->outbuf->id; + this, b->id, port->id, outsize); + port->io->buffer_id = b->id; spa_list_remove(&b->link); b->outstanding = true; } else { spa_log_trace(this->log, NAME " %p: keeping buffer %d on port %d %zd %zd", - this, b->outbuf->id, port->id, port->queued_bytes, outsize); + this, b->id, port->id, port->queued_bytes, outsize); } } static int mix_output(struct impl *this, size_t n_bytes) { struct buffer *outbuf; - int i, layer; + uint32_t i, layer; struct port *outport; struct spa_io_buffers *outio; struct spa_data *od; @@ -823,7 +825,7 @@ static int mix_output(struct impl *this, size_t n_bytes) len2 = n_bytes - len1; spa_log_trace(this->log, NAME " %p: dequeue output buffer %d %zd %d %d %d", - this, outbuf->outbuf->id, n_bytes, offset, len1, len2); + this, outbuf->id, n_bytes, offset, len1, len2); for (layer = 0, i = 0; i < this->last_port; i++) { struct port *in_port = GET_IN_PORT(this, i); @@ -846,7 +848,7 @@ static int mix_output(struct impl *this, size_t n_bytes) od[0].chunk->size = n_bytes; od[0].chunk->stride = 0; - outio->buffer_id = outbuf->outbuf->id; + outio->buffer_id = outbuf->id; outio->status = SPA_STATUS_HAVE_BUFFER; return SPA_STATUS_HAVE_BUFFER; @@ -857,7 +859,7 @@ static int impl_node_process(struct spa_node *node) struct impl *this; struct port *outport; struct spa_io_buffers *outio; - int i; + uint32_t i; size_t min_queued = SIZE_MAX; spa_return_val_if_fail(node != NULL, -EINVAL); diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index c022569c..03e87001 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -49,6 +49,7 @@ struct props { #define MAX_PORTS 1 struct buffer { + uint32_t id; struct spa_buffer *outbuf; bool outstanding; struct spa_meta_header *h; @@ -238,7 +239,7 @@ static int consume_buffer(struct impl *this) n_bytes = b->outbuf->datas[0].maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->outbuf->id); + spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); render_buffer(this, b); @@ -256,7 +257,7 @@ static int consume_buffer(struct impl *this) this->elapsed_time = this->buffer_count; set_timer(this, true); - io->buffer_id = b->outbuf->id; + io->buffer_id = b->id; io->status = SPA_STATUS_NEED_BUFFER; b->outstanding = true; @@ -600,6 +601,7 @@ impl_node_port_use_buffers(struct spa_node *node, struct spa_data *d = buffers[i]->datas; b = &this->buffers[i]; + b->id = i; b->outbuf = buffers[i]; b->outstanding = true; b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index 491f404c..12dbdd2d 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -50,6 +50,7 @@ struct props { #define MAX_PORTS 1 struct buffer { + uint32_t id; struct spa_buffer *outbuf; bool outstanding; struct spa_meta_header *h; @@ -251,7 +252,7 @@ static int make_buffer(struct impl *this) n_bytes = b->outbuf->datas[0].maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->outbuf->id); + spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); fill_buffer(this, b); @@ -269,7 +270,7 @@ static int make_buffer(struct impl *this) this->elapsed_time = this->buffer_count; set_timer(this, true); - io->buffer_id = b->outbuf->id; + io->buffer_id = b->id; io->status = SPA_STATUS_HAVE_BUFFER; return SPA_STATUS_HAVE_BUFFER; @@ -615,6 +616,7 @@ impl_node_port_use_buffers(struct spa_node *node, struct spa_data *d = buffers[i]->datas; b = &this->buffers[i]; + b->id = i; b->outbuf = buffers[i]; b->outstanding = false; b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index d57d395b..d4cd5948 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -66,6 +66,7 @@ static void reset_props(struct props *props) #define MAX_PORTS 1 struct buffer { + uint32_t id; struct spa_buffer *outbuf; bool outstanding; struct spa_meta_header *h; @@ -237,6 +238,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; else this->info.flags &= ~SPA_PORT_INFO_FLAG_LIVE; + break; } default: return -ENOENT; @@ -300,7 +302,7 @@ static int make_buffer(struct impl *this) n_bytes = b->outbuf->datas[0].maxsize; - spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->outbuf->id); + spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); fill_buffer(this, b); @@ -318,7 +320,7 @@ static int make_buffer(struct impl *this) this->elapsed_time = FRAMES_TO_TIME(this, this->frame_count); set_timer(this, true); - io->buffer_id = b->outbuf->id; + io->buffer_id = b->id; io->status = SPA_STATUS_HAVE_BUFFER; return io->status; @@ -714,6 +716,7 @@ impl_node_port_use_buffers(struct spa_node *node, struct spa_data *d = buffers[i]->datas; b = &this->buffers[i]; + b->id = i; b->outbuf = buffers[i]; b->outstanding = false; b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 9d10ce6d..0f5afc31 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -53,6 +53,7 @@ static void reset_props(struct props *props) #define MAX_BUFFERS 16 struct buffer { + uint32_t id; struct spa_buffer *outbuf; bool outstanding; struct spa_meta_header *h; @@ -572,6 +573,7 @@ impl_node_port_use_buffers(struct spa_node *node, struct spa_data *d = buffers[i]->datas; b = &port->buffers[i]; + b->id = i; b->outbuf = buffers[i]; b->outstanding = direction == SPA_DIRECTION_INPUT; b->h = spa_buffer_find_meta_data(buffers[i], SPA_META_Header, sizeof(*b->h)); |