From nobody Fri Oct 15 09:14:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 31FC21809F68; Fri, 15 Oct 2021 09:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HW0w373jDz4kyV; Fri, 15 Oct 2021 09:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AD9239F1; Fri, 15 Oct 2021 09:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19F9Eh6w013686; Fri, 15 Oct 2021 09:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19F9Ehrm013684; Fri, 15 Oct 2021 09:14:43 GMT (envelope-from git) Date: Fri, 15 Oct 2021 09:14:43 GMT Message-Id: <202110150914.19F9Ehrm013684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 63dcf7fda2b0 - main - mixer(8): Fix mixer status line for /dev/dspX.vpY mixer devices. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63dcf7fda2b0ec1a2f74406dd26a659914a0c17c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=63dcf7fda2b0ec1a2f74406dd26a659914a0c17c commit 63dcf7fda2b0ec1a2f74406dd26a659914a0c17c Author: Hans Petter Selasky AuthorDate: 2021-10-15 09:11:44 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-15 09:13:29 +0000 mixer(8): Fix mixer status line for /dev/dspX.vpY mixer devices. In some cases when passing /dev/dspX.vpY as mixer devices, m->ci.longname and m->ci.hw_info will be empty. Don't print any brackets and parentheses in this case. Differential Revision: https://reviews.freebsd.org/D32500 Submitted by: christos@ Sponsored by: NVIDIA Networking --- usr.sbin/mixer/mixer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index c32b87fdb7f0..f0e0c2d3b22b 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -219,15 +219,23 @@ printminfo(struct mixer *m, int oflag) if (oflag) return; - printf("%s: <%s> %s", m->mi.name, m->ci.longname, m->ci.hw_info); - printf(" ("); + printf("%s:", m->mi.name); + if (*m->ci.longname != '\0') + printf(" <%s>", m->ci.longname); + if (*m->ci.hw_info != '\0') + printf(" %s", m->ci.hw_info); + + if (m->mode != 0) + printf(" ("); if (m->mode & MIX_MODE_PLAY) printf("play"); if ((m->mode & playrec) == playrec) printf("/"); if (m->mode & MIX_MODE_REC) printf("rec"); - printf(")"); + if (m->mode != 0) + printf(")"); + if (m->f_default) printf(" (default)"); printf("\n");