aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-01-07 22:51:50 +0100
committerMax Kellermann <max@duempel.org>2011-01-07 22:52:50 +0100
commit4c09aeb5a1ac7dbf80af680c18f4e36d4776dc8c (patch)
tree0c1842bfb866d90c96b9c81d9b774dc679585e4f
parentaf892e7e804ccf96356e8f71239a1bce9616da02 (diff)
downloadmpd-4c09aeb5a1ac7dbf80af680c18f4e36d4776dc8c.tar.gz
mpd-4c09aeb5a1ac7dbf80af680c18f4e36d4776dc8c.tar.xz
mpd-4c09aeb5a1ac7dbf80af680c18f4e36d4776dc8c.zip
player_thread: fix assertion failure due to early seek
Until the decoder plugin has called decoder_initialized(), the player may not submit seek commands. This however could occur with a slow decoder and a CUE file with a virtual song offset. This patch adds another check.
-rw-r--r--NEWS1
-rw-r--r--src/player_thread.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index f56f55647..be21282e2 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ ver 0.16.1 (2010/??/??)
* output:
- solaris: add missing parameter to open_cloexec() cal
- osx: fix up audio format first, then apply it to device
+* player_thread: fix assertion failure due to early seek
ver 0.16 (2010/12/11)
diff --git a/src/player_thread.c b/src/player_thread.c
index cdcff3f92..776d6667f 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -869,6 +869,10 @@ static void do_play(struct decoder_control *dc)
/* seek to the beginning of the range */
const struct song *song = decoder_current_song(dc);
if (song != NULL && song->start_ms > 0 &&
+ /* we must not send a seek command until
+ the decoder is initialized
+ completely */
+ !player.decoder_starting &&
!dc_seek(dc, song->start_ms / 1000.0))
player_dc_stop(&player);