aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--NEWS2
-rw-r--r--src/decoder_api.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3202bc05e..1f19983a7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
ver 0.16.8 (2012/??/??)
* fix for libsamplerate assertion failure
+* decoder:
+ - vorbis (and others): fix seeking at startup
ver 0.16.7 (2012/02/04)
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 */