aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:29:37 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:29:37 +0200
commit9521c92f66c01a08526d14b92d581c858629101d (patch)
tree2e52a0235d6f9c7588890dcf1c608b2c4a9883e8
parent70904adf18611348b3cefdda9aae437442ba90a8 (diff)
downloadmpd-9521c92f66c01a08526d14b92d581c858629101d.tar.gz
mpd-9521c92f66c01a08526d14b92d581c858629101d.tar.xz
mpd-9521c92f66c01a08526d14b92d581c858629101d.zip
player_thread: removed decode(), renamed decodeParent()
decode() is a trivial wrapper for decodeParent(). Merge both and rename them to do_play().
Diffstat (limited to '')
-rw-r--r--src/player_thread.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index bdc140852..482b9d4e1 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -165,7 +165,7 @@ static int playChunk(ob_chunk * chunk,
return 0;
}
-static void decodeParent(void)
+static void do_play(void)
{
int do_pause = 0;
int buffering = 1;
@@ -181,8 +181,10 @@ static void decodeParent(void)
/** the position of the first chunk in the next song */
int next = -1;
+ ob_clear();
ob_set_lazy(0);
+ dc_start(&pc.notify, pc.next_song);
if (waitOnDecode(&decodeWaitedOn) < 0) {
quitDecode();
return;
@@ -371,19 +373,6 @@ static void decodeParent(void)
quitDecode();
}
-/* decode w/ buffering
- * this will fork another process
- * child process does decoding
- * parent process does playing audio
- */
-static void decode(void)
-{
- ob_clear();
-
- dc_start(&pc.notify, pc.next_song);
- decodeParent();
-}
-
static void * player_task(mpd_unused void *arg)
{
notify_enter(&pc.notify);
@@ -391,7 +380,7 @@ static void * player_task(mpd_unused void *arg)
while (1) {
switch (pc.command) {
case PLAYER_COMMAND_PLAY:
- decode();
+ do_play();
break;
case PLAYER_COMMAND_STOP: