aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-12 20:46:24 +0200
committerMax Kellermann <max@duempel.org>2014-07-12 20:46:24 +0200
commita73834436fb3947aa69d571026171c16d2434cec (patch)
treea1b3211f62c93e6fd85f893647451ccd9015b044
parent85f4aeca05ba51e3081fe0ddc7f463d64be5dce8 (diff)
downloadmpd-a73834436fb3947aa69d571026171c16d2434cec.tar.gz
mpd-a73834436fb3947aa69d571026171c16d2434cec.tar.xz
mpd-a73834436fb3947aa69d571026171c16d2434cec.zip
decoder/dsdiff: simplify loop condition, merge branches
-rw-r--r--src/decoder/DsdiffDecoderPlugin.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/decoder/DsdiffDecoderPlugin.cxx b/src/decoder/DsdiffDecoderPlugin.cxx
index dba921de5..5d9a679da 100644
--- a/src/decoder/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/DsdiffDecoderPlugin.cxx
@@ -260,8 +260,7 @@ dsdiff_read_metadata_extra(Decoder *decoder, InputStream &is,
/* Now process all the remaining chunk headers in the stream
and record their position and size */
- const auto size = is.GetSize();
- while (is.GetOffset() < size) {
+ do {
uint64_t chunk_size = chunk_header->GetSize();
/* DIIN chunk, is directly followed by other chunks */
@@ -291,12 +290,8 @@ dsdiff_read_metadata_extra(Decoder *decoder, InputStream &is,
if (!dsdlib_skip(decoder, is, chunk_size))
break;
}
+ } while (dsdiff_read_chunk_header(decoder, is, chunk_header));
- if (is.GetOffset() < size) {
- if (!dsdiff_read_chunk_header(decoder, is, chunk_header))
- break;
- }
- }
/* done processing chunk headers, process tags if any */
#ifdef HAVE_ID3TAG