aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-13 18:27:43 +0100
committerMax Kellermann <max@duempel.org>2012-02-13 18:27:43 +0100
commite1e3ce980af1f2fb1c4b4f3e4788a4f478bc43e7 (patch)
treee4623d44dfd156e8f98b18c9ea9a42257e3f3b23 /src/decoder_api.c
parent7855a3257980e45dec7cc57e998a5b4fa1504903 (diff)
downloadmpd-e1e3ce980af1f2fb1c4b4f3e4788a4f478bc43e7.tar.gz
mpd-e1e3ce980af1f2fb1c4b4f3e4788a4f478bc43e7.tar.xz
mpd-e1e3ce980af1f2fb1c4b4f3e4788a4f478bc43e7.zip
decoder_api: check state before emitting initial seek command
This fixes seeking in the vorbis decoder during MPD startup.
Diffstat (limited to 'src/decoder_api.c')
-rw-r--r--src/decoder_api.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 695ca0281..19de47855 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -89,6 +89,12 @@ decoder_prepare_initial_seek(struct decoder *decoder)
const struct decoder_control *dc = decoder->dc;
assert(dc->pipe != NULL);
+ if (dc->state != DECODE_STATE_DECODE)
+ /* wait until the decoder has finished initialisation
+ (reading file headers etc.) before emitting the
+ virtual "SEEK" command */
+ return false;
+
if (decoder->initial_seek_running)
/* initial seek has already begun - override any other
command */