From: Geoffrey McRae <geoff@hostfission.com>
To: <qemu-devel@nongnu.org>
Cc: <kraxel@redhat.com>
Subject: [PATCH 6/6] audio/jack: simplify the re-init code path
Date: Fri, 12 Jun 2020 01:25:16 +1000 [thread overview]
Message-ID: <20200612001612.EE1AF3A06BF@moya.office.hostfission.com> (raw)
Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
---
audio/jackaudio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index b2b53985ae..72ed7c4929 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -395,6 +395,10 @@ static int qjack_client_init(QJackClient *c)
char client_name[jack_client_name_size()];
jack_options_t options = JackNullOption;
+ if (c->state == QJACK_STATE_RUNNING) {
+ return 0;
+ }
+
c->connect_ports = true;
snprintf(client_name, sizeof(client_name), "%s-%s",
@@ -485,9 +489,7 @@ static int qjack_init_out(HWVoiceOut *hw, struct audsettings *as,
QJackOut *jo = (QJackOut *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (jo->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&jo->c);
jo->c.out = true;
jo->c.enabled = false;
@@ -523,9 +525,7 @@ static int qjack_init_in(HWVoiceIn *hw, struct audsettings *as,
QJackIn *ji = (QJackIn *)hw;
Audiodev *dev = (Audiodev *)drv_opaque;
- if (ji->c.state != QJACK_STATE_DISCONNECTED) {
- return 0;
- }
+ qjack_client_fini(&ji->c);
ji->c.out = false;
ji->c.enabled = false;
--
2.20.1
next reply other threads:[~2020-06-12 0:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-11 15:25 Geoffrey McRae [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-13 4:05 [PATCH 0/6] audio/jack: fixes to overall jack behaviour Geoffrey McRae
2020-06-13 4:05 ` [PATCH 6/6] audio/jack: simplify the re-init code path Geoffrey McRae
2020-06-11 15:25 Geoffrey McRae
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200612001612.EE1AF3A06BF@moya.office.hostfission.com \
--to=geoff@hostfission.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).