|
From: | José Ramón Muñoz Pekkarinen |
Subject: | Re: [PATCH] Autoconnect jack ports by default |
Date: | Wed, 24 Feb 2021 18:16:58 +0200 |
This patch provides a default value to connect
jack ports when the user don't specify connect-ports.
Buglink: https://bugs.launchpad.net/qemu/+bug/1908832
Signed-off-by: José Pekkarinen <koalinux@gmail.com>
---
audio/jackaudio.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index 3031c4e29b..a29b1ccba2 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -369,14 +369,23 @@ static size_t qjack_read(HWVoiceIn *hw, void *buf, size_t len)
static void qjack_client_connect_ports(QJackClient *c)
{
- if (!c->connect_ports || !c->opt->connect_ports) {
+ if (!c->connect_ports) {
return;
}
c->connect_ports = false;
const char **ports;
- ports = jack_get_ports(c->client, c->opt->connect_ports, NULL,
- c->out ? JackPortIsInput : JackPortIsOutput);
+ if (c->out) {
+ ports = jack_get_ports(c->client,
+ c->opt->connect_ports ? "system:capture_.*"
+ : c->opt->connect_ports,
+ NULL, JackPortIsInput);
+ } else {
+ ports = jack_get_ports(c->client,
+ c->opt->connect_ports ? "system:playback_.*"
+ : c->opt->connect_ports,
+ NULL, JackPortIsOutput);
+ }
if (!ports) {
return;
--
2.26.2
[Prev in Thread] | Current Thread | [Next in Thread] |