aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/DsdiffDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-23 15:14:16 +0200
committerMax Kellermann <max@duempel.org>2014-08-23 15:14:16 +0200
commit40db9dff3b74dfde97a537d10b11d649ab93d459 (patch)
tree7be947dadd28fd0786e5b1990a9786fc2c1b7dfa /src/decoder/plugins/DsdiffDecoderPlugin.cxx
parentfa82264604e6a8e342c932e8fd526017622e3f9f (diff)
downloadmpd-40db9dff3b74dfde97a537d10b11d649ab93d459.tar.gz
mpd-40db9dff3b74dfde97a537d10b11d649ab93d459.tar.xz
mpd-40db9dff3b74dfde97a537d10b11d649ab93d459.zip
decoder/dsdiff: support only one "DSD" chunk
Eliminate the loop from dsdiff_stream_decode(). It makes the code complex, real-world files with multiple DSD chunks are outside of the specification, and the "chunk_size" variable would be bogus anyway.
Diffstat (limited to 'src/decoder/plugins/DsdiffDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/DsdiffDecoderPlugin.cxx25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
index 941cfbc7b..a771ecf01 100644
--- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
@@ -434,27 +434,10 @@ dsdiff_stream_decode(Decoder &decoder, InputStream &is)
/* every iteration of the following loop decodes one "DSD"
chunk from a DFF file */
- while (true) {
- chunk_size = chunk_header.GetSize();
-
- if (chunk_header.id.Equals("DSD ")) {
- if (!dsdiff_decode_chunk(decoder, is,
- metadata.channels,
- metadata.sample_rate,
- chunk_size))
- break;
- } else {
- /* ignore other chunks */
- if (!dsdlib_skip(&decoder, is, chunk_size))
- break;
- }
-
- /* read next chunk header; the first one was read by
- dsdiff_read_metadata() */
- if (!dsdiff_read_chunk_header(&decoder,
- is, &chunk_header))
- break;
- }
+ dsdiff_decode_chunk(decoder, is,
+ metadata.channels,
+ metadata.sample_rate,
+ chunk_size);
}
static bool