aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-25 18:00:31 +0100
committerMax Kellermann <max@duempel.org>2009-03-25 18:00:31 +0100
commit933fcf42326972c93dfa840ef06e2639e16cc43d (patch)
treef0f803fcd842fd98b81d6af411740f890a8c11b1 /src/player_thread.c
parent4dbf73d88bf5ab2da154ac2f537aa28a67c5f8b6 (diff)
downloadmpd-933fcf42326972c93dfa840ef06e2639e16cc43d.tar.gz
mpd-933fcf42326972c93dfa840ef06e2639e16cc43d.tar.xz
mpd-933fcf42326972c93dfa840ef06e2639e16cc43d.zip
output_all: moved code to audio_output_all_wait()
Synchronization with the output thread will be implemented in output_all.c, not in player_thread.c. Currently, that's just a simple g_usleep(1ms).
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 59443696c..84487c7bb 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -192,14 +192,10 @@ player_check_decoder_startup(struct player *player)
/* the decoder is ready and ok */
if (audio_format_defined(&player->play_audio_format) &&
- audio_output_all_check() > 0) {
+ !audio_output_all_wait(1))
/* the output devices havn't finished playing
all chunks yet - wait for that */
-
- /* XXX synchronize in a better way */
- g_usleep(1000);
return true;
- }
player->decoder_starting = false;
@@ -479,14 +475,10 @@ play_next_chunk(struct player *player)
unsigned cross_fade_position;
bool success;
- if (audio_output_all_check() >= 64) {
+ if (!audio_output_all_wait(64))
/* the output pipe is still large enough, don't send
another chunk */
-
- /* XXX synchronize in a better way */
- g_usleep(1000);
return true;
- }
if (player->xfade == XFADE_ENABLED &&
dc.pipe != NULL && dc.pipe != player->pipe &&