From: Eric Wong <normalperson@yhbt.net>
To: "Måns Rullgård" <mans@mansr.com>
Cc: sox-devel@lists.sourceforge.net, Alexandre Ratchov <alex@caoua.org>
Subject: [PATCH RESEND 4/9] sndio: handle 24-bit samples properly on OpenBSD
Date: Fri, 31 Jul 2020 09:37:56 +0000 [thread overview]
Message-ID: <20200731093801.23548-5-normalperson@yhbt.net> (raw)
In-Reply-To: <20200731093801.23548-1-normalperson@yhbt.net>
From: Alexandre Ratchov <alex@caoua.org>
Reported-by: Jan Stary <hans@stare.cz>
cf. http://marc.info/?l=openbsd-ports&m=147395657332262&w=2
---
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 = ft->signal.channels;
}
- if (ft->signal.precision > 0)
- reqpar.bits = ft->signal.precision;
switch (ft->encoding.encoding) {
case SOX_ENCODING_SIGN2:
reqpar.sig = 1;
@@ -127,6 +125,12 @@ static int startany(sox_format_t *ft, unsigned mode)
}
if (ft->encoding.bits_per_sample > 0)
reqpar.bits = ft->encoding.bits_per_sample;
+ else if (ft->signal.precision > 0)
+ reqpar.bits = ft->signal.precision;
+ else
+ reqpar.bits = SOX_DEFAULT_PRECISION;
+ reqpar.bps = (reqpar.bits + 7) / 8;
+ reqpar.msb = 1;
if (ft->encoding.reverse_bytes != sox_option_default) {
reqpar.le = SIO_LE_NATIVE;
if (ft->encoding.reverse_bytes)
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
next prev parent reply other threads:[~2020-07-31 9:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 9:37 [PATCH RESEND 0/9] some old accumulated patches Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 1/9] use non-blocking stdin for interactive mode Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 2/9] speed up "|program" inputs on Linux 2.6.35+ Eric Wong
2020-07-31 10:53 ` Måns Rullgård
2020-07-31 9:37 ` [PATCH RESEND 3/9] sox.1: fix section name Eric Wong
2020-07-31 9:37 ` Eric Wong [this message]
2020-07-31 10:59 ` [PATCH RESEND 4/9] sndio: handle 24-bit samples properly on OpenBSD Måns Rullgård
2020-07-31 9:37 ` [PATCH RESEND 5/9] Handle vorbis_analysis_headerout errors Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 6/9] fix manpage warning: "table wider than line width" Eric Wong
2020-07-31 9:37 ` [PATCH RESEND 7/9] spectrogram: remove arbitrary limit on height of spectrogram Eric Wong
2020-07-31 14:34 ` Måns Rullgård
[not found] ` <CAL4-wQpF-qOD=BRVPhgZFC7fjvFDV-rQx1stvwY_xCTyj5uooA@mail.gmail.com>
2020-08-13 16:20 ` Måns Rullgård
2020-08-13 16:30 ` Pander via SoX-devel
2020-08-13 16:38 ` Måns Rullgård
2020-07-31 9:38 ` [PATCH RESEND 8/9] Add spectrogram -n flag to normalise the output to maximum brightness Eric Wong
2020-07-31 9:38 ` [PATCH RESEND 9/9] Added average power spectrum for stat -freq -a Eric Wong
2020-08-01 11:52 ` Måns Rullgård
2020-08-02 1:03 ` Eric Wong
2020-08-02 10:43 ` Måns Rullgård
2020-08-02 10:52 ` Måns Rullgård
2020-08-03 12:44 ` Pander via SoX-devel
2020-08-03 13:41 ` Måns Rullgård
2020-07-31 10:13 ` [PATCH RESEND 0/9] some old accumulated patches Måns Rullgård
2020-07-31 21:16 ` Eric Wong
2020-07-31 21:44 ` Måns Rullgård
2020-08-01 16:57 ` Måns Rullgård
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-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200731093801.23548-5-normalperson@yhbt.net \
--to=sox-devel@lists.sourceforge.net \
--cc=alex@caoua.org \
--cc=mans@mansr.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).