audioconvert: apply ouput range to resampler as well

This commit is contained in:
Wim Taymans 2018-06-15 12:45:04 +02:00
parent 4ac21aea53
commit 18f0194008
2 changed files with 10 additions and 0 deletions

View file

@ -713,10 +713,15 @@ impl_node_port_set_io(struct spa_node *node,
uint32_t id, void *data, size_t size)
{
struct impl *this;
struct type *t;
spa_return_val_if_fail(node != NULL, -EINVAL);
this = SPA_CONTAINER_OF(node, struct impl, node);
t = &this->type;
if (id == t->io.ControlRange)
spa_node_port_set_io(this->resample, direction, 0, id, data, size);
return spa_node_port_set_io(this->fmt[direction], direction, port_id, id, data, size);
}

View file

@ -61,6 +61,7 @@ struct port {
uint32_t id;
struct spa_io_buffers *io;
struct spa_io_control_range *ctrl;
struct spa_port_info info;
bool have_format;
@ -675,6 +676,8 @@ impl_node_port_set_io(struct spa_node *node,
if (id == t->io.Buffers)
port->io = data;
else if (id == t->io.ControlRange)
port->ctrl = data;
else
return -ENOENT;
@ -784,6 +787,8 @@ static int impl_node_process(struct spa_node *node)
size = sb->datas[0].chunk->size;
maxsize = db->datas[0].maxsize;
if (outport->ctrl)
maxsize = SPA_MIN(outport->ctrl->max_size, maxsize);
pin_len = in_len = (size - inport->offset) / sizeof(float);
pout_len = out_len = (maxsize - outport->offset) / sizeof(float);