aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
commit92d9797b8cb5b51cdb1cb7f40b12a87ad91eac2e (patch)
tree7a5c5c7d171771631be14c7ab3a39185cda72cd3 /src/player.c
parentcff923b9d824773ca5446d72f3c6a54245580d87 (diff)
downloadmpd-92d9797b8cb5b51cdb1cb7f40b12a87ad91eac2e.tar.gz
mpd-92d9797b8cb5b51cdb1cb7f40b12a87ad91eac2e.tar.xz
mpd-92d9797b8cb5b51cdb1cb7f40b12a87ad91eac2e.zip
player: don't call STOP before CLOSE_AUDIO
playerWait() stops the player thread (twice!) and closes the output device. It should be well enough to just send CLOSE_AUDIO, without STOP. This requires a tiny change to the player thread code: make it break when CLOSE_AUDIO is sent.
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/player.c b/src/player.c
index fae405ae3..5c3319491 100644
--- a/src/player.c
+++ b/src/player.c
@@ -25,14 +25,6 @@
#include "os_compat.h"
#include "main_notify.h"
-static void playerCloseAudio(void);
-
-void playerWait(void)
-{
- playerStop();
- playerCloseAudio();
-}
-
static void set_current_song(Song *song)
{
assert(song != NULL);
@@ -76,6 +68,14 @@ void playerStop(void)
playerQueueUnlock();
}
+void playerWait(void)
+{
+ player_command(PLAYER_COMMAND_CLOSE_AUDIO);
+
+ pc.queueState = PLAYER_QUEUE_BLANK;
+ playerQueueUnlock();
+}
+
void playerKill(void) /* deprecated */
{
playerPause();
@@ -165,12 +165,6 @@ char *getPlayerErrorStr(void)
return *error ? error : NULL;
}
-static void playerCloseAudio(void)
-{
- playerStop();
- player_command(PLAYER_COMMAND_CLOSE_AUDIO);
-}
-
int queueSong(Song * song)
{
if (pc.queueState == PLAYER_QUEUE_BLANK) {