[vlc-devel] [RFI] Wasapi output restart on WinRT

Jean-Baptiste Kempf jb at videolan.org
Mon May 16 19:17:54 CEST 2016

On 16 May, Rémi Denis-Courmont wrote :
> On Monday 16 May 2016 18:43:02 Jean-Baptiste Kempf wrote:
> > Hello,
> > 
> > Attached is a (refused in the past) patch to fix an issue that happens
> > ONLY on WinRT: (win32 is totally fine)
> > 
> > - even if IAudioClient_Stop and Release are called on Stop(), on the
> > next Start(), the IAudioClient_Initialize call fails saying that
> > AUDCLNT_E_ALREADY_INITIALIZED, which is of course, wrong/weird.
> Are you sure you creating a new client instance every time, and not reusing 
> the same one as before?

I am sure of nothing except that I exist. :D

>From what I see:
- Stop() calls vlc_module_unload, and then aout_stream_Stop that calls
  the wasapi.c:Stop() function. This one calls IAudioClient_Stop, and
- Start() calls ActivateDevice which calls IAudioClient_AddRef (there is
  no equivalent to MMDevice::Activate in WinRT), and
  then aout_stream_Activate and IAudioClient_Initialize()

Maybe the issue is that the only equivalent to MMDevice::Activate is
ActivateAudioInterfaceAsync and can only be called in the UI thread... 

> I rejected that patch because that error cannot safely be ignored. In 
> particular you could have mismatched audio formats.

Yep, I understood that :)

With my kindest regards,

Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device

More information about the vlc-devel mailing list