aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/DsfDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-09 20:02:07 +0200
committerMax Kellermann <max@duempel.org>2014-07-09 20:02:07 +0200
commit913064d6cc0dcfddb4eee0dcddacc5c82fa31448 (patch)
tree9ca3e14da0d2c355a65170ad994d47c1ac60c17a /src/decoder/plugins/DsfDecoderPlugin.cxx
parentfb45b8a5c94070d30e9a8ef33b04cb44c113515b (diff)
parent09384df32cc6bef40bc3630de1c928d2eb424909 (diff)
downloadmpd-913064d6cc0dcfddb4eee0dcddacc5c82fa31448.tar.gz
mpd-913064d6cc0dcfddb4eee0dcddacc5c82fa31448.tar.xz
mpd-913064d6cc0dcfddb4eee0dcddacc5c82fa31448.zip
Merge branch 'v0.18.x'
Diffstat (limited to 'src/decoder/plugins/DsfDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx
index 6fbaf6bf6..6a7267f61 100644
--- a/src/decoder/plugins/DsfDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsfDecoderPlugin.cxx
@@ -100,7 +100,7 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
DsfMetaData *metadata)
{
DsfHeader dsf_header;
- if (!dsdlib_read(decoder, is, &dsf_header, sizeof(dsf_header)) ||
+ if (!decoder_read_full(decoder, is, &dsf_header, sizeof(dsf_header)) ||
!dsf_header.id.Equals("DSD "))
return false;
@@ -114,7 +114,8 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
/* read the 'fmt ' chunk of the DSF file */
DsfFmtChunk dsf_fmt_chunk;
- if (!dsdlib_read(decoder, is, &dsf_fmt_chunk, sizeof(dsf_fmt_chunk)) ||
+ if (!decoder_read_full(decoder, is,
+ &dsf_fmt_chunk, sizeof(dsf_fmt_chunk)) ||
!dsf_fmt_chunk.id.Equals("fmt "))
return false;
@@ -140,7 +141,7 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
/* read the 'data' chunk of the DSF file */
DsfDataChunk data_chunk;
- if (!dsdlib_read(decoder, is, &data_chunk, sizeof(data_chunk)) ||
+ if (!decoder_read_full(decoder, is, &data_chunk, sizeof(data_chunk)) ||
!data_chunk.id.Equals("data"))
return false;
@@ -244,10 +245,10 @@ dsf_decode_chunk(Decoder &decoder, InputStream &is,
now_size = now_frames * frame_size;
}
- size_t nbytes = decoder_read(&decoder, is, buffer, now_size);
- if (nbytes != now_size)
+ if (!decoder_read_full(&decoder, is, buffer, now_size))
return false;
+ const size_t nbytes = now_size;
chunk_size -= nbytes;
if (bitreverse)