Media.Parse in ForEach loop crashes program
Summary
Using Media.Parse() in a foreach loop crashes with The program '[24996] LibVLCSharp_Test.dll' has exited with code -1073741819 (0xc0000005).
I tested on the past version of libvlc and libvlcsharp the bug still happens.
Minimal project and steps to reproduce
https://github.com/NHodgesVFX/LibVLCSharp_MediaParse_Issue
Set inDir to a folder with lots of videos around 5 or more should be fine. run the project, the program will successfully complete the first couple videos then abruptly exit.
What is the current bug behavior?
Attempting to use media.parse in a foreach loop results in the program exiting with a access violation.
What is the expected correct behavior?
Assuming my code is correct, I would expect media.Parse would not crash the program no matter how many times it is called in a foreach loop.
Does it work on other plaforms? Does it work with the official VLC apps?
I was unable to test on other platforms, this bug wouldn't really be possible to test on the vlc app.
Relevant logs and/or screenshots
Environment
- OS: Windows 10 64bit
- Version 10.0.19042 Build 19042
- Device:
- LibVLC version and architecture 3.0.12 x64
- LibVLCSharp version 3.4.9