Crash in libwasapi_plugin.dll upon switching media
Context
- VLC version: 4 / 63bd2aa0
- Audio Output:
mmdevice
Issue
Sometimes libvlc crashes at https://code.videolan.org/videolan/vlc/-/blob/63bd2aa0f1494ff065277ce74663817935a12c1d/modules/audio_output/wasapi.c#L237 (Access violation) when calling libvlc_media_player_play
after switching the current media.
As far as I can tell, aout_stream_owner_Stop
(which in turn releases the IAudioClient
) gets called too early in mmdevice.c
.
The winstore
audio output works fine, though.
(winstore
waits for its output thread to terminate before calling audio_stream_owner_Stop
(https://code.videolan.org/videolan/vlc/-/blob/63bd2aa0f1494ff065277ce74663817935a12c1d/modules/audio_output/winstore.c#L665-668) while mmdevice
doesn't (see https://code.videolan.org/videolan/vlc/-/blob/63bd2aa0f1494ff065277ce74663817935a12c1d/modules/audio_output/mmdevice.c#L1281).)