On Sun, Aug 26, 2012 at 10:33:23PM +0200, Alexandre Ratchov wrote:
> - the unsigned 8-bit 'sig' parameter is wrong, probably
>   would result in distortion
> 
> - audacious uses 24-bit samples packed in 4-byte words
>   LSB aligned, not MSB aligned.
> 
> OK?
> 
> -- Alexandre

Here is a fixed diff..

And 24-bit output does now work OK.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/audio/audacious-plugins/Makefile,v
retrieving revision 1.51
diff -u -p -r1.51 Makefile
--- Makefile    25 Aug 2012 11:30:19 -0000      1.51
+++ Makefile    26 Aug 2012 20:50:31 -0000
@@ -7,6 +7,7 @@ COMMENT =               input and output plugins for 
 V =                    3.3.1
 
 DISTNAME =             audacious-plugins-$V
+REVISION =             0
 
 CATEGORIES =           audio multimedia
 
Index: patches/patch-src_sndio_sndio_c
===================================================================
RCS file: patches/patch-src_sndio_sndio_c
diff -N patches/patch-src_sndio_sndio_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sndio_sndio_c     26 Aug 2012 20:54:02 -0000
@@ -0,0 +1,30 @@
+$OpenBSD$
+--- src/sndio/sndio.c.orig     Sun Aug 26 16:51:15 2012
++++ src/sndio/sndio.c  Sun Aug 26 16:53:50 2012
+@@ -95,7 +95,7 @@ AUD_OUTPUT_PLUGIN
+ static struct fmt_to_par {
+       int fmt, bits, sig, le;
+ } fmt_to_par[] = {
+-      {FMT_S8,      8, 1, 0}, {FMT_U8,      8, 1, 0},
++      {FMT_S8,      8, 1, 0}, {FMT_U8,      8, 0, 0},
+       {FMT_S16_LE, 16, 1, 1}, {FMT_S16_BE, 16, 1, 0},
+       {FMT_U16_LE, 16, 0, 1}, {FMT_U16_BE, 16, 0, 0},
+       {FMT_S24_LE, 24, 1, 1}, {FMT_S24_BE, 24, 1, 0},
+@@ -237,6 +237,8 @@ sndio_open(int fmt, int rate, int nch)
+       askpar.sig = fmt_to_par[i].sig;
+       if (askpar.bits > 8)
+               askpar.le = fmt_to_par[i].le;
++      if (askpar.bits < askpar.bps * 8)                                       
                                                                                
                                                           
++              askpar.msb = 0;
+       askpar.pchan = nch;
+       askpar.rate = rate;
+       buffer_size = aud_get_int(NULL, "output_buffer_size");
+@@ -249,7 +251,7 @@ sndio_open(int fmt, int rate, int nch)
+               return (0);
+       }
+       if ((par.bps > 1 && par.le != askpar.le) ||
+-          (par.bits < par.bps * 8 && !par.msb) ||
++          (par.bits < par.bps * 8 && par.msb) ||
+           par.bps != askpar.bps ||
+           par.sig != askpar.sig ||
+           par.pchan != askpar.pchan ||

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to