diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:15 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:15 +0200 |
commit | f46de2c32f3ca1dc4c8496830aa7bf6c703838a6 (patch) | |
tree | 6c363b964bed517e7ad116c754a168ea4411997c /src/inputPlugins/mp3_plugin.c | |
parent | e530181e233f315f90c31e0d4aae63449222f46c (diff) | |
download | mpd-f46de2c32f3ca1dc4c8496830aa7bf6c703838a6.tar.gz mpd-f46de2c32f3ca1dc4c8496830aa7bf6c703838a6.tar.xz mpd-f46de2c32f3ca1dc4c8496830aa7bf6c703838a6.zip |
mp3, flac: check for seek command after decoder_read()
When we introduced decoder_read(), we added code which aborts the read
operation when a decoder command arrives. Several plugins however did
not expect that when they were converted to decoder_read(). Add
proper checks to the mp3 and flac decoder plugins.
Diffstat (limited to '')
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 9b22dc74c..c836a7a46 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -1006,9 +1006,18 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) break; } - if (decoder_get_command(decoder) != DECODE_COMMAND_NONE) + switch (decoder_get_command(decoder)) { + case DECODE_COMMAND_NONE: + case DECODE_COMMAND_START: + break; + + case DECODE_COMMAND_STOP: return DECODE_BREAK; + case DECODE_COMMAND_SEEK: + return DECODE_CONT; + } + return ret; } |