decoder: PCM decoder: Break loop if EOF is encountered

Otherwise the song playing might go on forever.
This commit is contained in:
Simon Kagstrom 2011-03-20 17:26:28 +01:00 committed by Max Kellermann
parent d9353c4fd3
commit 0b12fae84d

View File

@ -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)