aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-07 10:10:43 +0200
committerMax Kellermann <max@duempel.org>2011-10-07 10:10:43 +0200
commit894b9cfdb9fb69dbdde937c32726508472601402 (patch)
treef9c7a7efb85bb30f49d3048ba6206fb9a043f588
parent7ecbb0454f4cbdd10389e06531bc9889cd7fbe5d (diff)
downloadmpd-894b9cfdb9fb69dbdde937c32726508472601402.tar.gz
mpd-894b9cfdb9fb69dbdde937c32726508472601402.tar.xz
mpd-894b9cfdb9fb69dbdde937c32726508472601402.zip
decoder/dsdiff: add option "lsbitfirst"
Defaults to "no", which fixes the noise problems.
-rw-r--r--doc/user.xml23
-rw-r--r--src/decoder/dsdiff_decoder_plugin.c12
2 files changed, 34 insertions, 1 deletions
diff --git a/doc/user.xml b/doc/user.xml
index 2e654bcca..394b8b0de 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -742,6 +742,29 @@ cd mpd-version</programlisting>
<para>
Decodes DFF files containing DSDIFF data (e.g. SACD rips).
</para>
+
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Setting</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <varname>lsbitfirst</varname>
+ <parameter>yes|no</parameter>
+ </entry>
+ <entry>
+ Decode the least significant bit first. Default is
+ "no".
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
</section>
<section>
diff --git a/src/decoder/dsdiff_decoder_plugin.c b/src/decoder/dsdiff_decoder_plugin.c
index 2c03cce5b..367f8708b 100644
--- a/src/decoder/dsdiff_decoder_plugin.c
+++ b/src/decoder/dsdiff_decoder_plugin.c
@@ -54,6 +54,15 @@ struct dsdiff_metadata {
unsigned sample_rate, channels;
};
+static bool lsbitfirst;
+
+static bool
+dsdiff_init(const struct config_param *param)
+{
+ lsbitfirst = config_get_block_bool(param, "lsbitfirst", false);
+ return true;
+}
+
static bool
dsdiff_id_equals(const struct dsdiff_id *id, const char *s)
{
@@ -356,7 +365,7 @@ dsdiff_decode_chunk(struct decoder *decoder, struct input_stream *is,
for (unsigned c = 0; c < channels; ++c)
dsd2pcm_translate(dsd2pcm[c], now_frames,
buffer + c, channels,
- true, f_buffer + c, channels);
+ lsbitfirst, f_buffer + c, channels);
/* convert to integer and submit to the decoder API */
@@ -485,6 +494,7 @@ static const char *const dsdiff_mime_types[] = {
const struct decoder_plugin dsdiff_decoder_plugin = {
.name = "dsdiff",
+ .init = dsdiff_init,
.stream_decode = dsdiff_stream_decode,
.stream_tag = dsdiff_stream_tag,
.suffixes = dsdiff_suffixes,