Windows/Audio: add listener for device change

For some reason XAudio2 doesn't automatically change the device anymore.
So let's just listen for the OnDefaultDeviceChanged event and update the cell audio thread if necessary.
This commit is contained in:
Megamouse 2021-08-23 21:33:20 +02:00
parent 4e139ee080
commit 72f0637efe
10 changed files with 161 additions and 8 deletions

View file

@ -305,7 +305,6 @@ u64 audio_ringbuffer::update()
//cellAudio.error("play_delta=%llu delta_samples=%llu", play_delta, delta_samples);
if (delta_samples > 0)
{
if (enqueued_samples < delta_samples)
{
enqueued_samples = 0;
@ -618,6 +617,7 @@ void cell_audio_thread::operator()()
{
if (m_update_configuration)
{
cellAudio.warning("Updating cell_audio_thread configuration");
update_config();
m_update_configuration = false;
}