From 40db9dff3b74dfde97a537d10b11d649ab93d459 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 23 Aug 2014 15:14:16 +0200 Subject: 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. --- src/decoder/plugins/DsdiffDecoderPlugin.cxx | 25 ++++--------------------- 1 file 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 -- cgit v1.2.3