aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-11 09:20:34 +0100
committerMax Kellermann <max@duempel.org>2009-03-11 09:20:34 +0100
commit13cd6b28348d2b744a01bea03c4764860f31f909 (patch)
tree34c4e1d5263ac127b73170ccd6609343d5d0ff36 /src/player_thread.c
parent903a07b80e61581555971d1d7150044790130821 (diff)
downloadmpd-13cd6b28348d2b744a01bea03c4764860f31f909.tar.gz
mpd-13cd6b28348d2b744a01bea03c4764860f31f909.tar.xz
mpd-13cd6b28348d2b744a01bea03c4764860f31f909.zip
player_thread: removed player_stop_decoder()
Replaced both player_stop_decoder() invocations with player_dc_stop(), which also cleans up the pipe.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 54c83c6b5..e1e2b21a7 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -125,13 +125,6 @@ player_dc_stop(struct player *player)
}
}
-static void player_stop_decoder(void)
-{
- dc_stop(&pc.notify);
- pc.state = PLAYER_STATE_STOP;
- event_pipe_emit(PIPE_EVENT_PLAYLIST);
-}
-
static bool
player_wait_for_decoder(struct player *player)
{
@@ -562,9 +555,10 @@ static void do_play(void)
dc.pipe = player.pipe;
dc_start(&pc.notify, pc.next_song);
if (!player_wait_for_decoder(&player)) {
- player_stop_decoder();
+ player_dc_stop(&player);
player_command_finished();
music_pipe_free(player.pipe);
+ event_pipe_emit(PIPE_EVENT_PLAYLIST);
return;
}
@@ -685,15 +679,13 @@ static void do_play(void)
pc.next_song = NULL;
}
- player_stop_decoder();
-
- if (dc.pipe != NULL && dc.pipe != player.pipe) {
- music_pipe_clear(dc.pipe, player_buffer);
- music_pipe_free(dc.pipe);
- }
+ player_dc_stop(&player);
music_pipe_clear(player.pipe, player_buffer);
music_pipe_free(player.pipe);
+
+ pc.state = PLAYER_STATE_STOP;
+ event_pipe_emit(PIPE_EVENT_PLAYLIST);
}
static gpointer player_task(G_GNUC_UNUSED gpointer arg)