player_thread: don't start the decoder asynchronously

The START command returns without blocking; we don't need the
asynchronous decoder start anymore.
This commit is contained in:
Max Kellermann 2009-11-03 19:18:17 +01:00
parent 77a647fc26
commit acb265d082
3 changed files with 2 additions and 17 deletions

View File

@ -93,16 +93,6 @@ dc_start(struct decoder_control *dc, struct song *song)
dc_command(dc, DECODE_COMMAND_START); dc_command(dc, DECODE_COMMAND_START);
} }
void
dc_start_async(struct decoder_control *dc, struct song *song)
{
assert(dc->pipe != NULL);
assert(song != NULL);
dc->next_song = song;
dc_command_async(dc, DECODE_COMMAND_START);
}
void void
dc_stop(struct decoder_control *dc) dc_stop(struct decoder_control *dc)
{ {

View File

@ -211,9 +211,6 @@ dc_command_wait(struct decoder_control *dc);
void void
dc_start(struct decoder_control *dc, struct song *song); dc_start(struct decoder_control *dc, struct song *song);
void
dc_start_async(struct decoder_control *dc, struct song *song);
void void
dc_stop(struct decoder_control *dc); dc_stop(struct decoder_control *dc);

View File

@ -159,8 +159,6 @@ player_wait_for_decoder(struct player *player)
{ {
struct decoder_control *dc = player->dc; struct decoder_control *dc = player->dc;
dc_command_wait(dc);
if (decoder_lock_has_failed(dc)) { if (decoder_lock_has_failed(dc)) {
assert(dc->next_song == NULL || dc->next_song->uri != NULL); assert(dc->next_song == NULL || dc->next_song->uri != NULL);
@ -331,7 +329,7 @@ static bool player_seek_decoder(struct player *player)
dc->pipe = player->pipe; dc->pipe = player->pipe;
/* re-start the decoder */ /* re-start the decoder */
dc_start_async(dc, pc.next_song); dc_start(dc, pc.next_song);
ret = player_wait_for_decoder(player); ret = player_wait_for_decoder(player);
if (!ret) { if (!ret) {
/* decoder failure */ /* decoder failure */
@ -793,7 +791,7 @@ static void do_play(struct decoder_control *dc)
player.queued = false; player.queued = false;
dc->pipe = music_pipe_new(); dc->pipe = music_pipe_new();
dc_start_async(dc, pc.next_song); dc_start(dc, pc.next_song);
} }
if (dc->pipe != NULL && dc->pipe != player.pipe && if (dc->pipe != NULL && dc->pipe != player.pipe &&