On Sat, Jun 09, 2012 at 12:58:16PM +0100, Stuart Henderson wrote:
>
> Any idea about this? Does it seem more likely to be a problem with
> deadbeef or with sndiod? It's not too important whether the resampling
> is done in sndiod or in deadbeef but it doesn't work anywhere for me.
>
> File is 22KHz stereo (though I get the same with any non-48KHz files
> that I've tried).
>
does this help? Here, it fixes playback of stereo, 22050Hz, u8
files. At least on the command line, the GUI still crashes when I
load such a file through File->Open dialog.
-- Alexandre
--- sndio.c.old.3 Sat Jun 9 11:09:50 2012
+++ sndio.c Sat Jun 9 15:00:28 2012
@@ -87,7 +87,7 @@ sndio_init(void)
par.bits = plugin.fmt.bps;
par.bps = SIO_BPS(plugin.fmt.bps);
par.sig = 1;
- par.le = SIO_LE_NATIVE;
+ par.le = plugin.fmt.is_bigendian ? 0 : 1;
par.appbufsz = par.rate * buffer_ms / 1000;
askpar = par;
@@ -107,7 +107,11 @@ sndio_init(void)
}
/* not support float format */
+ plugin.fmt.bps = par.bits;
+ plugin.fmt.channels = par.pchan;
+ plugin.fmt.samplerate = par.rate;
plugin.fmt.is_float = 0;
+ plugin.fmt.is_bigendian = par.le ? 0 : 1;
bufsz = par.bps * par.pchan * par.round;
buf = malloc(bufsz);
@@ -344,9 +348,10 @@ static DB_output_t plugin = {
.unpause = sndio_unpause,
.state = sndio_get_state,
.has_volume = 1,
- .fmt.samplerate = 48000,
- .fmt.channels = 2,
.fmt.bps = 16,
+ .fmt.channels = 2,
+ .fmt.samplerate = 48000,
+ .fmt.channelmask = DDB_SPEAKER_FRONT_LEFT | DDB_SPEAKER_FRONT_RIGHT,
.fmt.is_float = 0,
- .fmt.channelmask = DDB_SPEAKER_FRONT_LEFT | DDB_SPEAKER_FRONT_RIGHT
+ .fmt.is_bigendian = SIO_LE_NATIVE ? 0 : 1
};