Commit 2c1d3be4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

wasapi: restart aout if device is invalidated (fixes #6826)

parent f0362f18
...@@ -93,7 +93,7 @@ struct aout_sys_t ...@@ -93,7 +93,7 @@ struct aout_sys_t
static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift) static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift)
{ {
aout_sys_t *sys = aout->sys; aout_sys_t *sys = aout->sys;
HRESULT hr; HRESULT hr = S_OK;
Enter(); Enter();
if (likely(sys->clock != NULL)) if (likely(sys->clock != NULL))
...@@ -158,6 +158,10 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift) ...@@ -158,6 +158,10 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift)
Leave(); Leave();
block_Release(block); block_Release(block);
/* Restart on unplug */
if (unlikely(hr == AUDCLNT_E_DEVICE_INVALIDATED))
var_TriggerCallback(aout, "audio-device");
} }
static void Pause(audio_output_t *aout, bool paused, mtime_t date) static void Pause(audio_output_t *aout, bool paused, mtime_t date)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment