[vlc-commits] wasapi: restart aout if device is invalidated (fixes #6826)
Rémi Denis-Courmont
git at videolan.org
Thu Aug 2 17:26:06 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 2 18:01:36 2012 +0300| [2c1d3be4a40a7246178ebf889d038bfef7e067fd] | committer: Rémi Denis-Courmont
wasapi: restart aout if device is invalidated (fixes #6826)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c1d3be4a40a7246178ebf889d038bfef7e067fd
---
modules/audio_output/wasapi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 97b45a1..25532b7 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -93,7 +93,7 @@ struct aout_sys_t
static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift)
{
aout_sys_t *sys = aout->sys;
- HRESULT hr;
+ HRESULT hr = S_OK;
Enter();
if (likely(sys->clock != NULL))
@@ -158,6 +158,10 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift)
Leave();
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)
More information about the vlc-commits
mailing list