From 20538516b92082067ce3477d612fb404ba8671ad Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 9 Jul 2014 19:05:20 +0200 Subject: decoder/audiofile: use decoder_read_full() Works around WAV stream playback bug, because libaudiofile does not like partial reads (Mantis 0004028). --- NEWS | 1 + src/decoder/AudiofileDecoderPlugin.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 19e3b2219..d6fd59519 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ver 0.18.12 (not yet released) - proxy: fix add/search and other commands with libmpdclient < 2.9 * decoder - audiofile: improve responsiveness + - audiofile: fix WAV stream playback ver 0.18.11 (2014/05/12) * decoder 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; } }; -- cgit v1.2.3