diff options
author | Simon Kagstrom <simon.kagstrom@gmail.com> | 2011-03-20 17:26:28 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-03-23 22:13:08 +0100 |
commit | 0b12fae84da92498db612d3fabf57edfad65fa9d (patch) | |
tree | c4b02c7cf8d1861417cb597aa05716cd27cd6bcf /src/decoder/pcm_decoder_plugin.c | |
parent | d9353c4fd32a9645e9f9a5463f42a0fd44f0a70c (diff) | |
download | mpd-0b12fae84da92498db612d3fabf57edfad65fa9d.tar.gz mpd-0b12fae84da92498db612d3fabf57edfad65fa9d.tar.xz mpd-0b12fae84da92498db612d3fabf57edfad65fa9d.zip |
decoder: PCM decoder: Break loop if EOF is encountered
Otherwise the song playing might go on forever.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/pcm_decoder_plugin.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/decoder/pcm_decoder_plugin.c b/src/decoder/pcm_decoder_plugin.c index 882d59a36..1da21c209 100644 --- a/src/decoder/pcm_decoder_plugin.c +++ b/src/decoder/pcm_decoder_plugin.c @@ -51,6 +51,10 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is) size_t nbytes = decoder_read(decoder, is, buffer, sizeof(buffer)); + + if (nbytes == 0 && input_stream_eof(is)) + break; + cmd = nbytes > 0 ? decoder_data(decoder, is, buffer, nbytes, 0) |