aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-21 23:17:34 +0200
committerMax Kellermann <max@duempel.org>2011-09-22 00:04:48 +0200
commit525a791987c66ed2f8b1ca9e5357836f536fdb8b (patch)
tree5244d5bab9f7ab1a2f2ea0ee92ab24e6076f7d3b /src/player_thread.c
parentfb19210cfd3ec20d69f53ea258c36ef72e002edd (diff)
downloadmpd-525a791987c66ed2f8b1ca9e5357836f536fdb8b.tar.gz
mpd-525a791987c66ed2f8b1ca9e5357836f536fdb8b.tar.xz
mpd-525a791987c66ed2f8b1ca9e5357836f536fdb8b.zip
decoder_api: emulate SEEK command for initial seek to CUE track
When playing a CUE track, the player thread waited for the decoder to become ready, and then sent a SEEK command to the beginning of the CUE track. If that is near the start of the song file, and the track is short enough, the decoder could have finished decoding already at that point, and seeking fails. This commit makes this initial seek more robust: instead of letting the player thread deal with the difficult timings, let the decoder API emulate a SEEK command, and return it to the decoder plugin, as soon as the plugin finishes its initialization.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index a89e59908..be08aa32d 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -881,16 +881,6 @@ static void do_play(struct decoder_control *dc)
if (!player_check_decoder_startup(&player))
break;
- /* 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);
-
player_lock();
continue;
}