mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
jack: activate/deactivate should trigger port register
Port added before activate should trigger a port_register callback when the client is activated. When calling jack_deactivate, the port_register callback should be called. See #2638
This commit is contained in:
parent
0f0d56e783
commit
b87f7251d8
1 changed files with 20 additions and 6 deletions
|
|
@ -3780,6 +3780,7 @@ SPA_EXPORT
|
||||||
int jack_activate (jack_client_t *client)
|
int jack_activate (jack_client_t *client)
|
||||||
{
|
{
|
||||||
struct client *c = (struct client *) client;
|
struct client *c = (struct client *) client;
|
||||||
|
struct object *o;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
spa_return_val_if_fail(c != NULL, -EINVAL);
|
spa_return_val_if_fail(c != NULL, -EINVAL);
|
||||||
|
|
@ -3800,8 +3801,13 @@ int jack_activate (jack_client_t *client)
|
||||||
|
|
||||||
c->active = true;
|
c->active = true;
|
||||||
|
|
||||||
|
spa_list_for_each(o, &c->context.objects, link) {
|
||||||
|
if (o->type != INTERFACE_Port || o->port.port == NULL ||
|
||||||
|
o->port.port->client != c || !o->port.port->valid)
|
||||||
|
continue;
|
||||||
|
do_callback(c, portregistration_callback, o->serial, 1, c->portregistration_arg);
|
||||||
|
}
|
||||||
do_callback(c, graph_callback, c->graph_arg);
|
do_callback(c, graph_callback, c->graph_arg);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
pw_data_loop_stop(c->loop);
|
pw_data_loop_stop(c->loop);
|
||||||
|
|
@ -3814,7 +3820,7 @@ done:
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
int jack_deactivate (jack_client_t *client)
|
int jack_deactivate (jack_client_t *client)
|
||||||
{
|
{
|
||||||
struct object *l;
|
struct object *o;
|
||||||
struct client *c = (struct client *) client;
|
struct client *c = (struct client *) client;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
|
@ -3835,13 +3841,21 @@ int jack_deactivate (jack_client_t *client)
|
||||||
c->activation->pending_new_pos = false;
|
c->activation->pending_new_pos = false;
|
||||||
c->activation->pending_sync = false;
|
c->activation->pending_sync = false;
|
||||||
|
|
||||||
spa_list_for_each(l, &c->context.objects, link) {
|
spa_list_for_each(o, &c->context.objects, link) {
|
||||||
if (l->type != INTERFACE_Link || l->removed)
|
if (o->type != INTERFACE_Link || o->removed)
|
||||||
continue;
|
continue;
|
||||||
if (l->port_link.src_ours || l->port_link.dst_ours)
|
if (o->port_link.src_ours || o->port_link.dst_ours)
|
||||||
pw_registry_destroy(c->registry, l->id);
|
pw_registry_destroy(c->registry, o->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spa_list_for_each(o, &c->context.objects, link) {
|
||||||
|
if (o->type != INTERFACE_Port || o->port.port == NULL ||
|
||||||
|
o->port.port->client != c || !o->port.port->valid)
|
||||||
|
continue;
|
||||||
|
pw_thread_loop_unlock(c->context.loop);
|
||||||
|
c->portregistration_callback(o->serial, 0, c->portregistration_arg);
|
||||||
|
pw_thread_loop_lock(c->context.loop);
|
||||||
|
}
|
||||||
res = do_sync(c);
|
res = do_sync(c);
|
||||||
|
|
||||||
pw_thread_loop_unlock(c->context.loop);
|
pw_thread_loop_unlock(c->context.loop);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue