mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05:00
jack: work on cleanup
This commit is contained in:
parent
8f7a19f2e3
commit
b7647e80d3
8 changed files with 76 additions and 31 deletions
|
|
@ -135,7 +135,7 @@ enum jack_notification_type {
|
|||
#define kGetUUIDByClient_size (JACK_CLIENT_NAME_SIZE+1)
|
||||
|
||||
#define CheckRead(var,size) if(read(client->fd,var,size)!=size) {pw_log_error("read error"); return -1; }
|
||||
#define CheckWrite(var,size) if(write(client->fd,var,size)!=size) {pw_log_error("write error"); return -1; }
|
||||
#define CheckWrite(var,size) if(send(client->fd,var,size,MSG_NOSIGNAL)!=size) {pw_log_error("write error"); return -1; }
|
||||
#define CheckSize(expected) { int __size; CheckRead(&__size, sizeof(int)); if (__size != expected) { pw_log_error("CheckSize error size %d != %d", __size, (int)expected); return -1; } }
|
||||
|
||||
#define jack_error pw_log_error
|
||||
|
|
|
|||
|
|
@ -530,9 +530,16 @@ static void port_destroy(void *data)
|
|||
jack_graph_manager_release_port(mgr, port->port_id);
|
||||
}
|
||||
|
||||
static void port_free(void *data)
|
||||
{
|
||||
struct port_data *pd = data;
|
||||
spa_hook_list_call(&pd->listener_list, struct pw_jack_port_events, free);
|
||||
}
|
||||
|
||||
static const struct pw_port_events port_events = {
|
||||
PW_VERSION_PORT_EVENTS,
|
||||
.destroy = port_destroy,
|
||||
.free = port_free,
|
||||
};
|
||||
|
||||
struct pw_jack_port *
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ struct pw_jack_port_events {
|
|||
uint32_t version;
|
||||
|
||||
void (*destroy) (void *data);
|
||||
|
||||
void (*free) (void *data);
|
||||
};
|
||||
|
||||
struct pw_jack_node *
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ struct jack_client {
|
|||
int fd; /* notify fd */
|
||||
struct spa_hook node_listener;
|
||||
struct spa_list client_link;
|
||||
bool activated;
|
||||
};
|
||||
|
||||
struct jack_server {
|
||||
|
|
|
|||
|
|
@ -437,6 +437,12 @@ jack_connection_manager_get_outputs(struct jack_connection_manager *conn, int re
|
|||
return GET_ITEMS_FIXED_ARRAY(conn->output_port[ref_num]);
|
||||
}
|
||||
|
||||
static inline const jack_int_t *
|
||||
jack_connection_manager_get_connections(struct jack_connection_manager *conn, int port_index)
|
||||
{
|
||||
return GET_ITEMS_FIXED_ARRAY(conn->connection[port_index]);
|
||||
}
|
||||
|
||||
static inline int
|
||||
jack_connection_manager_get_output_refnum(struct jack_connection_manager *conn,
|
||||
jack_port_id_t port_index)
|
||||
|
|
@ -591,14 +597,10 @@ jack_connection_manager_disconnect_ports(struct jack_connection_manager *conn,
|
|||
pw_log_error("connection %p: ports are not connected", conn);
|
||||
return -1;
|
||||
}
|
||||
if (jack_connection_manager_disconnect(conn, src_id, dst_id) < 0) {
|
||||
pw_log_error("connection %p: connection table is full", conn);
|
||||
return -1;
|
||||
}
|
||||
if (jack_connection_manager_disconnect(conn, dst_id, src_id) < 0) {
|
||||
pw_log_error("connection %p: connection table is full", conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
jack_connection_manager_disconnect(conn, src_id, dst_id);
|
||||
jack_connection_manager_disconnect(conn, dst_id, src_id);
|
||||
|
||||
if (jack_connection_manager_is_loop_path(conn, src_id, dst_id) < 0)
|
||||
jack_connection_manager_dec_feedback_connection(conn, src_id, dst_id);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue