aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:08 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:08 +0200
commitcdaa26c81d692fefe5c9c2a4a01dcff633c99564 (patch)
tree5f342c342a7f138e186ff3722db8b0f76806f898 /src/player.c
parentb1de50f994841e1803da365965512b925dfcc027 (diff)
downloadmpd-cdaa26c81d692fefe5c9c2a4a01dcff633c99564.tar.gz
mpd-cdaa26c81d692fefe5c9c2a4a01dcff633c99564.tar.xz
mpd-cdaa26c81d692fefe5c9c2a4a01dcff633c99564.zip
no busy-waiting for the player process
The function player_command() inherited the busy-waiting algorithm from the old code; throw in a wait_main_task() to do idle waiting.
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c
index 8f3f6a6e6..08ad94096 100644
--- a/src/player.c
+++ b/src/player.c
@@ -97,9 +97,10 @@ static void set_current_song(Song *song)
static void player_command(enum player_command cmd)
{
pc.command = cmd;
- while (pc.command != PLAYER_COMMAND_NONE)
- /* FIXME: _nb() variant is probably wrong here, and everywhere... */
+ while (pc.command != PLAYER_COMMAND_NONE) {
notify_signal(&pc.notify);
+ wait_main_task();
+ }
}
void player_command_finished()