[prev in list] [next in list] [prev in thread] [next in thread]
List: sox-devel
Subject: Re: [SoX-devel] [PATCH RESEND 4/9] sndio: handle 24-bit samples properly on OpenBSD
From: Måns_Rullgård <mans () mansr ! com>
Date: 2020-07-31 10:59:28
Message-ID: yw1xk0ykympb.fsf () mansr ! com
[Download RAW message or body]
Eric Wong <normalperson@yhbt.net> writes:
> 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)
I'm not familiar with OpenBSD, so I'll trust you guys that this is correct.
--
Måns Rullgård
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic