aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-13 02:06:55 +0100
committerMax Kellermann <max@duempel.org>2008-11-13 02:06:55 +0100
commit998d9a822535e3cb88801487e95acef296cae9a3 (patch)
tree1b157c09ffd9856511c21dc328faf89f93e9f1eb
parent1178e485cb2a978b8b7e8ba91a2ce6558da7682b (diff)
downloadmpd-998d9a822535e3cb88801487e95acef296cae9a3.tar.gz
mpd-998d9a822535e3cb88801487e95acef296cae9a3.tar.xz
mpd-998d9a822535e3cb88801487e95acef296cae9a3.zip
decoder: ignore SEEK commands during initialization
When the decoder receives a SEEK during initialization, it should ignore that for now. The old code made most decoders abort.
-rw-r--r--src/decoder_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 25616e569..1db6797a8 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -109,8 +109,11 @@ size_t decoder_read(struct decoder *decoder,
while (true) {
/* XXX don't allow decoder==NULL */
if (decoder != NULL &&
+ /* ignore the SEEK command during initialization,
+ the plugin should handle that after it has
+ initialized successfully */
(dc.command != DECODE_COMMAND_SEEK ||
- !decoder->seeking) &&
+ (dc.state != DECODE_STATE_START && !decoder->seeking)) &&
dc.command != DECODE_COMMAND_NONE)
return 0;