From 0b12fae84da92498db612d3fabf57edfad65fa9d Mon Sep 17 00:00:00 2001 From: Simon Kagstrom Date: Sun, 20 Mar 2011 17:26:28 +0100 Subject: decoder: PCM decoder: Break loop if EOF is encountered Otherwise the song playing might go on forever. --- src/decoder/pcm_decoder_plugin.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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) -- cgit v1.2.3