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.
This commit is contained in:
Max Kellermann 2009-03-10 20:41:27 +01:00
parent 92d74d4a78
commit 5dfad1d5d6

View File

@ -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,