aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:04 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:04 +0200
commit241cd043ca4f9dd560e6d947a9bf025f58de4ea9 (patch)
treed674656743e506ca5ae183638fdddc5f3c411dc8 /src/player.c
parent87beded44f0798c80744fcaebb06cac9ce8bbf39 (diff)
downloadmpd-241cd043ca4f9dd560e6d947a9bf025f58de4ea9.tar.gz
mpd-241cd043ca4f9dd560e6d947a9bf025f58de4ea9.tar.xz
mpd-241cd043ca4f9dd560e6d947a9bf025f58de4ea9.zip
invoke the notify API directly
Don't use wrappers like player_wakeup_decoder_nb(). These have been wrappers calling notify.c functions, for compatibility with the existing code when we migrated to notify.c.
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/player.c b/src/player.c
index 61b380b84..e7ec926e4 100644
--- a/src/player.c
+++ b/src/player.c
@@ -27,22 +27,12 @@
static void playerCloseAudio(void);
-void wakeup_player_nb(void)
-{
- notify_signal(&pc.notify);
-}
-
static void wakeup_player(void)
{
notify_signal(&pc.notify);
wait_main_task();
}
-void player_sleep(void)
-{
- notify_wait(&pc.notify);
-}
-
static void * player_task(mpd_unused void *arg)
{
notify_enter(&pc.notify);
@@ -67,7 +57,7 @@ static void * player_task(mpd_unused void *arg)
pc.queueLockState = PLAYER_QUEUE_UNLOCKED;
pc.unlockQueue = 0;
} else {
- player_sleep();
+ notify_wait(&pc.notify);
continue;
}
/* we did something, tell the main task about it */
@@ -112,7 +102,7 @@ int playerPlay(int fd, Song * song)
pc.play = 1;
/* FIXME: _nb() variant is probably wrong here, and everywhere... */
- do { wakeup_player_nb(); } while (pc.play);
+ do { notify_signal(&pc.notify); } while (pc.play);
return 0;
}
@@ -249,7 +239,7 @@ int getPlayerQueueState(void)
void setQueueState(int queueState)
{
pc.queueState = queueState;
- wakeup_player_nb();
+ notify_signal(&pc.notify);
}
void playerQueueLock(void)
@@ -285,7 +275,7 @@ int playerSeek(int fd, Song * song, float seek_time)
pc.seekWhere = seek_time;
pc.seek = 1;
/* FIXME: _nb() is probably wrong here, too */
- do { wakeup_player_nb(); } while (pc.seek);
+ do { notify_signal(&pc.notify); } while (pc.seek);
}
return 0;