From 933fcf42326972c93dfa840ef06e2639e16cc43d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 25 Mar 2009 18:00:31 +0100 Subject: 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). --- src/output_all.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/output_all.c') diff --git a/src/output_all.c b/src/output_all.c index 2e7d3a720..870d8aed3 100644 --- a/src/output_all.c +++ b/src/output_all.c @@ -408,6 +408,18 @@ audio_output_all_check(void) return 0; } +bool +audio_output_all_wait(unsigned threshold) +{ + if (audio_output_all_check() < threshold) + return true; + + /* XXX synchronize in a better way */ + g_usleep(1000); + + return audio_output_all_check() < threshold; +} + void audio_output_all_pause(void) { -- cgit v1.2.3