xbmc/xbmc — pull request #1326 by DDDamian (2012-08-25 03:09:06+00:00)
Title: [AE] Add AE::Suspend()/Resume() for external players and power saving

This PR addresses a regression post-AE where external players could not access the audio device while some sinks were used, including WASAPI and CA in hog-mode.

AE maintains a continuous stream of output at all times, eliminating the "silent-stream" bug and receiver drop-outs, as well as reducing sink re-openings.

In exclusive modes this interferes with external players or system sounds.

This PR addresses the issue by implementing Suspend() and Resume() functions which halt active output with quiet sleeps and de-initialize the sink to cede access to the audio device.

It is currently only utilized by externalplayer.cpp in this context, but can equally be used to reduce power consumption if called during hibernation code.

Routines are implemented in SoftAE, but only fleshed-out in CA and Pulse engines.