Commit 4c09aeb5 authored by Max Kellermann's avatar Max Kellermann

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.
parent af892e7e
...@@ -8,6 +8,7 @@ ver 0.16.1 (2010/??/??) ...@@ -8,6 +8,7 @@ ver 0.16.1 (2010/??/??)
* output: * output:
- solaris: add missing parameter to open_cloexec() cal - solaris: add missing parameter to open_cloexec() cal
- osx: fix up audio format first, then apply it to device - 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) ver 0.16 (2010/12/11)
......
...@@ -869,6 +869,10 @@ static void do_play(struct decoder_control *dc) ...@@ -869,6 +869,10 @@ static void do_play(struct decoder_control *dc)
/* seek to the beginning of the range */ /* seek to the beginning of the range */
const struct song *song = decoder_current_song(dc); const struct song *song = decoder_current_song(dc);
if (song != NULL && song->start_ms > 0 && 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)) !dc_seek(dc, song->start_ms / 1000.0))
player_dc_stop(&player); player_dc_stop(&player);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment