diff options
author | Max Kellermann <max@duempel.org> | 2009-03-25 19:48:14 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-25 19:48:14 +0100 |
commit | 209c8a540c80faffb6b04ac6e7fed64a03c679ac (patch) | |
tree | b484644f440e4c3d584e62ab751537fbc58d6055 /src/player_thread.c | |
parent | 1e9659bf1f84dc260129007a17cc4bbe1d146ada (diff) | |
download | mpd-209c8a540c80faffb6b04ac6e7fed64a03c679ac.tar.gz mpd-209c8a540c80faffb6b04ac6e7fed64a03c679ac.tar.xz mpd-209c8a540c80faffb6b04ac6e7fed64a03c679ac.zip |
player_thread: wait for decoder before seeking
When the decoder initialization has not been completed yet, all calls
to dc_seek() will fail, because dc.seekable is not initialized yet.
Wait for the decoder to complete its initialization, i.e. until it has
called decoder_initialized().
Diffstat (limited to '')
-rw-r--r-- | src/player_thread.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c index 84487c7bb..02f80ae8c 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -301,6 +301,17 @@ static bool player_seek_decoder(struct player *player) player->queued = false; } + /* wait for the decoder to complete initialization */ + + while (player->decoder_starting) { + ret = player_check_decoder_startup(player); + if (!ret) { + /* decoder failure */ + player_command_finished(); + return false; + } + } + /* send the SEEK command */ where = pc.seek_where; |