Commit 40db9dff authored by Max Kellermann's avatar Max Kellermann

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.
parent fa822646
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment