From 5dfad1d5d6493975a287f2b3c970540c62b97cc8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Mar 2009 20:41:27 +0100 Subject: [PATCH] output_thread: check commands while playing Check audio_output.command after each sub-chunk has been played. It discards the rest of the chunk, but since all commands make the device stop anyway, this is not a problem, but part of the improvement. This improves the latency of audio output commands. --- src/output_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output_thread.c b/src/output_thread.c index 786b04204..846f5e60e 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -87,7 +87,7 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk) return true; } - while (size > 0) { + while (size > 0 && ao->command == AO_COMMAND_NONE) { size_t nbytes; nbytes = ao_plugin_play(ao->plugin, ao->data, data, size,