简体   繁体   中英

C# WPF application crashing when playing 16 players

I am running into an issue with my C# WPF application crashing silently when I am trying to play on 16 VideoViews. I did not see any error messaged popup, nor did I see anything in Windows Event viewer.

Each player instance have WindowsFormHost and hosting a VideoView in that and I am playing RTSP streams on them.

Crash time is not fixed, sometimes it crash after 2 hours, and sometimes after 7-8 hours.

            Core.Initialize(AppInfo.VlcDir.FullName);

            private LibVLC libVlc = null;
            private LibVLCSharp.Shared.MediaPlayer mediaPlayer = null;

            this.libVlc = new LibVLC(this.GetParsedPlayerOptions().ToArray());
            this.mediaPlayer = new LibVLCSharp.Shared.MediaPlayer(this.libVlc);
            this.videoPlayer.MediaPlayer = this.mediaPlayer;

            this.mediaPlayer.Volume = 0;
            this.mediaPlayer.EnableKeyInput = false;
            this.mediaPlayer.EnableMouseInput = false;

            // Then I added a bunch of event handlers for VideoView and MediaPlayer.

            // Then I have a different function which plays videos
            if (this.mediaPlayer != null)
            {
                var media = new Media(this.libVlc,GetPlaybackStreamUrl(this.Server), FromType.FromLocation);
                this.mediaPlayer.Media = media;
                this.mediaPlayer.Play();
                try
                {
                    media.Dispose();
                }
                catch
                {
                }
            }

Please let me know if you need any more information.

Any suggestions of what I could be doing wrong, or anything missing?

I am running on Windows 10. Visual Studio 2019, application compiled as X86.

I am not able to find the option to upload log file, but I did attach that to the issue on videolan forum, which can be found here: https://code.videolan.org/videolan/LibVLCSharp/-/issues/564

Thanks.

I was not able to find the problem with the code or the crash stack for where it's dying. But I was able to fix the problem by increasing the address space, by using editbin to add /LARGEADDRESSSPACE to process post build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM