audioconvert: also set io_position on channelmix

Also make the channelmix node aware of the io_position so that
is can use this later to get the default rate.
This commit is contained in:
Wim Taymans 2021-06-14 12:11:10 +02:00
parent c726dd887c
commit ed80d72d51
2 changed files with 17 additions and 1 deletions

View file

@ -557,6 +557,7 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
switch (id) {
case SPA_IO_Position:
res = spa_node_set_io(this->resample, id, data, size);
res = spa_node_set_io(this->channelmix, id, data, size);
res = spa_node_set_io(this->fmt[0], id, data, size);
res = spa_node_set_io(this->fmt[1], id, data, size);
break;

View file

@ -144,6 +144,8 @@ struct impl {
struct spa_log *log;
struct spa_cpu *cpu;
struct spa_io_position *io_position;
struct spa_hook_list hooks;
uint64_t info_all;
@ -595,7 +597,20 @@ static int apply_midi(struct impl *this, const struct spa_pod *value)
static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
{
return -ENOTSUP;
struct impl *this = object;
spa_return_val_if_fail(this != NULL, -EINVAL);
spa_log_debug(this->log, NAME " %p: io %d %p/%zd", this, id, data, size);
switch (id) {
case SPA_IO_Position:
this->io_position = data;
break;
default:
return -ENOENT;
}
return 0;
}
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,