aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-06-04 23:14:38 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-06-04 23:14:38 +0000
commit01faa6f4e30e2a75319ca2b402f19fca0a6ae9b6 (patch)
tree2574f0d79287585635a687a6c1f9fadd2de3f7bf /src/player.c
parent10860b33d47517411abf6766e13f39c2375b4b08 (diff)
downloadmpd-01faa6f4e30e2a75319ca2b402f19fca0a6ae9b6.tar.gz
mpd-01faa6f4e30e2a75319ca2b402f19fca0a6ae9b6.tar.xz
mpd-01faa6f4e30e2a75319ca2b402f19fca0a6ae9b6.zip
Set a flag if we've sent the player process SIGSTOP so that we know not to
wait for it to complete an action which it never will. git-svn-id: https://svn.musicpd.org/mpd/trunk@6488 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/player.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/player.c b/src/player.c
index beff9b389..096503b19 100644
--- a/src/player.c
+++ b/src/player.c
@@ -110,11 +110,13 @@ void player_sigChldHandler(int pid, int status)
int playerInit(void)
{
+ PlayerControl *pc = &(getPlayerData()->playerControl);
int pid;
pid = player_pid;
if (pid > 0) {
kill(pid, SIGCONT);
+ pc->wait = 0;
return 0;
}
@@ -124,8 +126,6 @@ int playerInit(void)
{
clock_t start = clock();
- PlayerControl *pc = &(getPlayerData()->playerControl);
-
unblockSignals();
setSigHandlersForDecoder();
@@ -184,16 +184,22 @@ int playerInit(void)
int playerWait(int fd)
{
+ PlayerControl *pc = &(getPlayerData()->playerControl);
int pid;
+ if (pc->wait)
+ return 0;
+
if (playerStop(fd) < 0)
return -1;
playerCloseAudio();
pid = player_pid;
- if (pid > 0)
+ if (pid > 0) {
+ pc->wait = 1;
kill(pid, SIGSTOP);
+ }
return 0;
}