mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
link: select io right after mix init
This commit is contained in:
parent
1d3ce5a9d9
commit
47fc2020c0
2 changed files with 7 additions and 13 deletions
|
|
@ -52,7 +52,6 @@ struct impl {
|
|||
struct pw_link this;
|
||||
|
||||
bool prepare;
|
||||
bool have_io;
|
||||
bool activated;
|
||||
bool passive;
|
||||
|
||||
|
|
@ -528,9 +527,6 @@ static int select_io(struct pw_link *this)
|
|||
struct spa_io_buffers *io;
|
||||
int res;
|
||||
|
||||
if (impl->have_io)
|
||||
return 0;
|
||||
|
||||
io = this->rt.in_mix.io;
|
||||
if (io == NULL)
|
||||
io = this->rt.out_mix.io;
|
||||
|
|
@ -548,9 +544,6 @@ static int select_io(struct pw_link *this)
|
|||
return res;
|
||||
|
||||
this->io = io;
|
||||
|
||||
impl->have_io = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -741,11 +734,6 @@ static int do_allocation(struct pw_link *this)
|
|||
goto error;
|
||||
}
|
||||
|
||||
if ((res = select_io(this)) < 0) {
|
||||
asprintf(&error, "link %p: error can set io: %s", this, spa_strerror(res));
|
||||
goto error;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
error:
|
||||
|
|
@ -1212,6 +1200,7 @@ struct pw_link *pw_link_new(struct pw_core *core,
|
|||
struct impl *impl;
|
||||
struct pw_link *this;
|
||||
struct pw_node *input_node, *output_node;
|
||||
int res;
|
||||
|
||||
if (output == input)
|
||||
goto same_ports;
|
||||
|
|
@ -1277,6 +1266,9 @@ struct pw_link *pw_link_new(struct pw_core *core,
|
|||
pw_port_init_mix(output, &this->rt.out_mix);
|
||||
pw_port_init_mix(input, &this->rt.in_mix);
|
||||
|
||||
if ((res = select_io(this)) < 0)
|
||||
goto no_io;
|
||||
|
||||
if (this->feedback) {
|
||||
impl->inode = output_node;
|
||||
impl->onode = input_node;
|
||||
|
|
@ -1304,6 +1296,9 @@ struct pw_link *pw_link_new(struct pw_core *core,
|
|||
|
||||
return this;
|
||||
|
||||
no_io:
|
||||
asprintf(error, "can't set io %d (%s)", res, spa_strerror(res));
|
||||
return NULL;
|
||||
same_ports:
|
||||
asprintf(error, "can't link the same ports");
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -1339,7 +1339,6 @@ do_process(struct spa_loop *loop,
|
|||
struct stream *impl = user_data;
|
||||
struct buffer *b;
|
||||
struct spa_io_buffers *io = impl->io;
|
||||
int res;
|
||||
|
||||
if ((b = pop_queue(impl, &impl->queued)) != NULL) {
|
||||
io->buffer_id = b->id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue