aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/oggflac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
commit6df980a996192fc459a0b60b73fa7a33a24a2f49 (patch)
tree6d56dd5e3fe17c33e10c46832a1cec91733b8875 /src/inputPlugins/oggflac_plugin.c
parent8a5109483dc2d705cf927ab107f2b4a8e8008415 (diff)
downloadmpd-6df980a996192fc459a0b60b73fa7a33a24a2f49.tar.gz
mpd-6df980a996192fc459a0b60b73fa7a33a24a2f49.tar.xz
mpd-6df980a996192fc459a0b60b73fa7a33a24a2f49.zip
flac: decoder command means EOF
It was possible for the decoder thread to go into an endless loop (flac and oggflac decoders): when a "STOP" command arrived, the Read() callback would return 0, but the EOF() callback returned false. Fix: when decoder_get_command()!=NONE, return EOF==true.
Diffstat (limited to 'src/inputPlugins/oggflac_plugin.c')
-rw-r--r--src/inputPlugins/oggflac_plugin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inputPlugins/oggflac_plugin.c b/src/inputPlugins/oggflac_plugin.c
index 2adbaed60..e0527f7b7 100644
--- a/src/inputPlugins/oggflac_plugin.c
+++ b/src/inputPlugins/oggflac_plugin.c
@@ -104,9 +104,9 @@ static FLAC__bool of_EOF_cb(const OggFLAC__SeekableStreamDecoder * decoder,
{
FlacData *data = (FlacData *) fdata;
- if (inputStreamAtEOF(data->inStream) == 1)
- return true;
- return false;
+ return (decoder_get_command(data->decoder) != DECODE_COMMAND_NONE &&
+ decoder_get_command(data->decoder) != DECODE_COMMAND_SEEK) ||
+ inputStreamAtEOF(data->inStream);
}
static void of_error_cb(const OggFLAC__SeekableStreamDecoder * decoder,