diff options
author | Max Kellermann <max@duempel.org> | 2014-07-09 19:05:20 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-07-09 19:05:20 +0200 |
commit | 20538516b92082067ce3477d612fb404ba8671ad (patch) | |
tree | 1365268be018b7ce410786ceb621e24a564a00ee /src/decoder/AudiofileDecoderPlugin.cxx | |
parent | 0759421d119d8d3d829978ede81683ca54d65d69 (diff) | |
download | mpd-20538516b92082067ce3477d612fb404ba8671ad.tar.gz mpd-20538516b92082067ce3477d612fb404ba8671ad.tar.xz mpd-20538516b92082067ce3477d612fb404ba8671ad.zip |
decoder/audiofile: use decoder_read_full()
Works around WAV stream playback bug, because libaudiofile does not
like partial reads (Mantis 0004028).
Diffstat (limited to '')
-rw-r--r-- | src/decoder/AudiofileDecoderPlugin.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/decoder/AudiofileDecoderPlugin.cxx b/src/decoder/AudiofileDecoderPlugin.cxx index 7c76deb7d..3fb23bc20 100644 --- a/src/decoder/AudiofileDecoderPlugin.cxx +++ b/src/decoder/AudiofileDecoderPlugin.cxx @@ -43,7 +43,12 @@ struct AudioFileInputStream { InputStream &is; size_t Read(void *buffer, size_t size) { - return decoder_read(decoder, is, buffer, size); + /* libaudiofile does not like partial reads at all, + and wil abort playback; therefore always force full + reads */ + return decoder_read_full(decoder, is, buffer, size) + ? size + : 0; } }; |