mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
jack: sort midi ports before audio ports
for compatibility reasons return the audio ports before the midi ports. Most apps just try to link the first hw ports they see and jack always lists the hw audio ports first.
This commit is contained in:
parent
f777c04ea6
commit
b85b88b53d
1 changed files with 24 additions and 22 deletions
|
|
@ -3443,7 +3443,7 @@ const char ** jack_get_ports (jack_client_t *client,
|
||||||
int count = 0;
|
int count = 0;
|
||||||
struct object *o;
|
struct object *o;
|
||||||
const char *str;
|
const char *str;
|
||||||
uint32_t id;
|
uint32_t i, id;
|
||||||
regex_t port_regex, type_regex;
|
regex_t port_regex, type_regex;
|
||||||
|
|
||||||
if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
if ((str = getenv("PIPEWIRE_NODE")) != NULL)
|
||||||
|
|
@ -3461,10 +3461,13 @@ const char ** jack_get_ports (jack_client_t *client,
|
||||||
pw_log_debug(NAME" %p: ports id:%d name:%s type:%s flags:%08lx", c, id,
|
pw_log_debug(NAME" %p: ports id:%d name:%s type:%s flags:%08lx", c, id,
|
||||||
port_name_pattern, type_name_pattern, flags);
|
port_name_pattern, type_name_pattern, flags);
|
||||||
|
|
||||||
|
for (i = 0; i < 2; i++) {
|
||||||
spa_list_for_each(o, &c->context.ports, link) {
|
spa_list_for_each(o, &c->context.ports, link) {
|
||||||
pw_log_debug(NAME" %p: check port type:%d flags:%08lx name:%s", c,
|
pw_log_debug(NAME" %p: check port type:%d flags:%08lx name:%s", c,
|
||||||
o->port.type_id, o->port.flags, o->port.name);
|
o->port.type_id, o->port.flags, o->port.name);
|
||||||
if (o->port.type_id == 2)
|
if (count == JACK_PORT_MAX)
|
||||||
|
break;
|
||||||
|
if (o->port.type_id != i)
|
||||||
continue;
|
continue;
|
||||||
if (!SPA_FLAG_CHECK(o->port.flags, flags))
|
if (!SPA_FLAG_CHECK(o->port.flags, flags))
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -3483,8 +3486,7 @@ const char ** jack_get_ports (jack_client_t *client,
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: port %s matches (%d)", c, o->port.name, count);
|
pw_log_debug(NAME" %p: port %s matches (%d)", c, o->port.name, count);
|
||||||
res[count++] = o->port.name;
|
res[count++] = o->port.name;
|
||||||
if (count == JACK_PORT_MAX)
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
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