From 6e21e24caed1a9497e876e4b89b12687aa73d6ad Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Sep 2008 16:43:55 +0200 Subject: audio_output: added method pause() pause() puts the audio output into pause mode: if supported, it may perform a special action, which keeps the device open, but does not play anything. Output plugins like "shout" might want to play silence during pause, so their clients won't be disconnected. Plugins which do not support pausing will simply be closed, and have to be reopened when unpaused. This pach includes an implementation for the shout plugin, which sends silence chunks. --- src/audio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/audio.c') diff --git a/src/audio.c b/src/audio.c index bbc7fd0eb..b38c47d72 100644 --- a/src/audio.c +++ b/src/audio.c @@ -397,6 +397,19 @@ int playAudio(const char *playChunk, size_t size) return 0; } +void audio_output_pause_all(void) +{ + unsigned int i; + + syncAudioDeviceStates(); + + for (i = 0; i < audioOutputArraySize; ++i) + if (audio_output_is_open(&audioOutputArray[i])) + audio_output_pause(&audioOutputArray[i]); + + audio_output_wait_all(); +} + void dropBufferedAudio(void) { unsigned int i; -- cgit v1.2.3