alsa: implement set_io and handle position io

Use position io for deciding the size of the output buffers in
alsasrc
This commit is contained in:
Wim Taymans 2018-10-24 10:27:57 +02:00
parent 4aab226047
commit 2206deb3e8
4 changed files with 39 additions and 12 deletions

View file

@ -159,7 +159,23 @@ static int impl_node_enum_params(struct spa_node *node,
static int impl_node_set_io(struct spa_node *node, uint32_t id, void *data, size_t size)
{
return -ENOTSUP;
struct state *this;
spa_return_val_if_fail(node != NULL, -EINVAL);
this = SPA_CONTAINER_OF(node, struct state, node);
switch (id) {
case SPA_IO_Clock:
this->clock = data;
break;
case SPA_IO_Position:
this->position = data;
break;
default:
return -ENOENT;
}
return 0;
}
static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flags,