decoder/audiofile: use decoder_read_full()

Works around WAV stream playback bug, because libaudiofile does not
like partial reads (Mantis 0004028).
This commit is contained in:
Max Kellermann 2014-07-09 19:05:20 +02:00
parent 0759421d11
commit 20538516b9
2 changed files with 7 additions and 1 deletions

1
NEWS
View File

@ -4,6 +4,7 @@ ver 0.18.12 (not yet released)
- proxy: fix add/search and other commands with libmpdclient < 2.9 - proxy: fix add/search and other commands with libmpdclient < 2.9
* decoder * decoder
- audiofile: improve responsiveness - audiofile: improve responsiveness
- audiofile: fix WAV stream playback
ver 0.18.11 (2014/05/12) ver 0.18.11 (2014/05/12)
* decoder * decoder

View File

@ -43,7 +43,12 @@ struct AudioFileInputStream {
InputStream &is; InputStream &is;
size_t Read(void *buffer, size_t size) { 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;
} }
}; };