From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5CCB01F5AE for ; Fri, 31 Jul 2020 10:59:43 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1k1SlG-0001s4-VA; Fri, 31 Jul 2020 10:59:38 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1SlF-0001rw-IH for sox-devel@lists.sourceforge.net; Fri, 31 Jul 2020 10:59:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=75zM9zi05RHP2mEjrBmjvpL7EkwqVv+3NZtgCAJTxpE=; b=mqok2z9k9BKNdBmEJZoLbkrdKu 2bQmXciWnmfh7qEdpzHVxGfiguPA7wEIfn5gDlSxHGtIaOo1O3YE8d/vSysthrjnOeC4mdWy9ifAF IAlyZpU0fBl3L6L1pglXfc/2t9UmvRjbII6RNq01UXGtireiM/4jS32n9OdwAg6nFOho=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=75zM9zi05RHP2mEjrBmjvpL7EkwqVv+3NZtgCAJTxpE=; b=haA99pW2VqhHLz87YT72Mh5ogi ongGSw7L/WzB6MLwn/cioZaz32H1iRMz1arZn020xzbuDswBWBdFOmelI/i7VMLEiYdi6NsUyRvcc xCiUr+GqmIgWy3Ygci5qE+m4987P61gQMnkQv+ArLTOv9kyPW11VSFGcklWrk2lrps+w=; Received: from unicorn.mansr.com ([81.2.72.234]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1k1SlD-00Fn4P-E9 for sox-devel@lists.sourceforge.net; Fri, 31 Jul 2020 10:59:37 +0000 Received: from raven.mansr.com (raven.mansr.com [81.2.72.235]) by unicorn.mansr.com (Postfix) with ESMTPS id 47D1D15360; Fri, 31 Jul 2020 11:59:28 +0100 (BST) Received: by raven.mansr.com (Postfix, from userid 51770) id 3BA7921A6F2; Fri, 31 Jul 2020 11:59:28 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Eric Wong References: <20200731093801.23548-1-normalperson@yhbt.net> <20200731093801.23548-5-normalperson@yhbt.net> Date: Fri, 31 Jul 2020 11:59:28 +0100 In-Reply-To: <20200731093801.23548-5-normalperson@yhbt.net> (Eric Wong's message of "Fri, 31 Jul 2020 09:37:56 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Headers-End: 1k1SlD-00Fn4P-E9 Subject: Re: [PATCH RESEND 4/9] sndio: handle 24-bit samples properly on OpenBSD X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-devel@lists.sourceforge.net Cc: sox-devel@lists.sourceforge.net, Alexandre Ratchov Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: sox-devel-bounces@lists.sourceforge.net Eric Wong writes: > From: Alexandre Ratchov > > Reported-by: Jan Stary > cf. http://marc.info/?l=3Dopenbsd-ports&m=3D147395657332262&w=3D2 > --- > src/sndio.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/src/sndio.c b/src/sndio.c > index e031b5bb..77785ce4 100644 > --- a/src/sndio.c > +++ b/src/sndio.c > @@ -113,8 +113,6 @@ static int startany(sox_format_t *ft, unsigned mode) > else > reqpar.rchan =3D ft->signal.channels; > } > - if (ft->signal.precision > 0) > - reqpar.bits =3D ft->signal.precision; > switch (ft->encoding.encoding) { > case SOX_ENCODING_SIGN2: > reqpar.sig =3D 1; > @@ -127,6 +125,12 @@ static int startany(sox_format_t *ft, unsigned mode) > } > if (ft->encoding.bits_per_sample > 0) > reqpar.bits =3D ft->encoding.bits_per_sample; > + else if (ft->signal.precision > 0) > + reqpar.bits =3D ft->signal.precision; > + else > + reqpar.bits =3D SOX_DEFAULT_PRECISION; > + reqpar.bps =3D (reqpar.bits + 7) / 8; > + reqpar.msb =3D 1; > if (ft->encoding.reverse_bytes !=3D sox_option_default) { > reqpar.le =3D SIO_LE_NATIVE; > if (ft->encoding.reverse_bytes) I'm not familiar with OpenBSD, so I'll trust you guys that this is correct. -- = M=E5ns Rullg=E5rd _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel