use vlcControl to loop video, Whenever it jumps to the 28th time, program will exit abnormally

0

I have two pages, A and B, A can play videos, B is a blank view, the program jumps between these two views.

I am trying to loop videos with vlcControl, Whenever it jumps to the 28th time, the program will exit abnormally.

When debugging,i found the program stopped at xxx.Designer.cs ((System.ComponentModel.ISupportInitialize)(this.vlcControl1)).EndInit();, it seems cannot Signal completion.

EndInit function

// Signals the object that initialization is complete.
void EndInit();
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;

namespace Ai.FMS
{
    public partial class vlcCirculation : Form
    {
        public vlcCirculation()
        {
            InitializeComponent();
        }
        string[] allFiles;
        List<string> playList = new List<string>();
        string videoPath = @".\video\测试视频";

        private void vlcCirculation_Load(object sender, EventArgs e)
        {
            vlcControl1.Location = new System.Drawing.Point(0, 0);
            vlcControl1.Size = new System.Drawing.Size(940, 1180);

            allFiles = Directory.GetFiles(videoPath);
            foreach (string strFile in allFiles)
            {
                playList.Add(strFile);
            }
            if (playList.Count > 0)
            {
                vlcControl1.SetMedia(new System.IO.FileInfo(playList[0]));
                vlcControl1.Play();
            }
        }


        private void myVlcControl_VlcLibDirectoryNeeded(object sender, Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs e)
        {
            var currentAssembly = Assembly.GetEntryAssembly();
            var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;

            if (currentDirectory == null)
                return;
            if (IntPtr.Size == 4)
                e.VlcLibDirectory = new DirectoryInfo(Path.GetFullPath(@".\libvlc\win-x86\"));
            else
                e.VlcLibDirectory = new DirectoryInfo(Path.GetFullPath(@".\libvlc\win-x64\"));

            if (!e.VlcLibDirectory.Exists)
            {
                var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
                folderBrowserDialog.Description = "Select Vlc libraries folder.";
                folderBrowserDialog.RootFolder = Environment.SpecialFolder.Desktop;
                folderBrowserDialog.ShowNewFolderButton = true;
                if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    e.VlcLibDirectory = new DirectoryInfo(folderBrowserDialog.SelectedPath);
                }
            }
        }

        private void vlcControl1_Stopped(object sender, Vlc.DotNet.Core.VlcMediaPlayerStoppedEventArgs e)
        {
            this.BeginInvoke(new Action(() =>
            {
                vlcControl1.Dispose();
                Hide();
                Close();
                Dispose();
                new finish(100, "123").Show();

            }));
        }

        private void vlcControl1_EndReached(object sender, Vlc.DotNet.Core.VlcMediaPlayerEndReachedEventArgs e)
        {
            playList.RemoveAt(0);
            if (playList.Count > 0)
            {
                Console.WriteLine("current video: {0}", playList[0]);
                ThreadPool.QueueUserWorkItem(_ => this.vlcControl1.Play(new System.IO.FileInfo(playList[0])));

            }
        }
    }
}

error log

[15b0fe38] mmdevice audio output error: cannot initialize COM (error 0x80010106) [1eb660b0] avcodec decoder: Using D3D11VA (Intel(R) HD Graphics 4600, vendor 8086(Intel), device 416, revision 6) for hardware decoding [1f7bbf20] avcodec decoder: Using D3D11VA (Intel(R) HD Graphics 4600, vendor 8086(Intel), device 416, revision 6) for hardware decoding [0eadef40] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 current video: .\video\测试视频\勇士_1.mp4 [15b0fe38] mmdevice audio output error: cannot initialize COM (error 0x80010106) [1eba4470] avcodec decoder: Using D3D11VA (Intel(R) HD Graphics 4600, vendor 8086(Intel), device 416, revision 6) for hardware decoding [1eb2ae10] avcodec decoder: Using D3D11VA (Intel(R) HD Graphics 4600, vendor 8086(Intel), device 416, revision 6) for hardware decoding [0eade518] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 current video: .\video\测试视频\勇士_1.mp4 [15b11e90] mmdevice audio output error: cannot initialize COM (error 0x80010106) [0eadeb30] direct3d11 vout display error: invalid Pixel Shader (hr=0x8007000E): (null) [0eadeb30] direct3d11 vout display error: Failed to create the pixel shader. (hr=0x80070057) [0eadeb30] direct3d11 vout display error: Failed to allocate format resources [0eadeb30] direct3d11 vout display error: Direct3D11 could not be opened [0eadeb30] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadeb30] direct3d9 vout display error: Could not read adapter capabilities. (hr=0x8876086a) [0eadeb30] direct3d9 vout display error: Direct3D9 could not be opened [0eadeb30] direct3d9 vout display error: SetThumbNailClip failed: 0x800706f4 [1e96b088] d3d11va generic error: Could not Query ID3D11VideoDevice Interface. (hr=0x80004002) [1e96b088] d3d11va generic error: CreateVideoService failed [0eadeb30] glwin32 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadef40] direct3d11 vout display error: invalid Pixel Shader (hr=0x8007000E): (null) [0eadef40] direct3d11 vout display error: Failed to create the pixel shader. (hr=0x80070057) [0eadef40] direct3d11 vout display error: Failed to allocate format resources [0eadef40] direct3d11 vout display error: Direct3D11 could not be opened [0eadef40] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadef40] direct3d9 vout display error: Could not read adapter capabilities. (hr=0x8876086a) [0eadef40] direct3d9 vout display error: Direct3D9 could not be opened [0eadef40] direct3d9 vout display error: SetThumbNailClip failed: 0x800706f4 [1f611060] direct3d9 generic error: Could not read adapter capabilities. (hr=0x8876086a) [1e96ad28] dxva2 generic error: Could not read adapter capabilities. (hr=0x8876086a) [1e96ad28] dxva2 generic error: IDirect3D9_CreateDevice failed [1e96ad28] dxva2 generic error: Failed to create device [0eadef40] glwin32 vout display error: SetThumbNailClip failed: 0x800706f4 [0eaded38] direct3d11 vout display error: invalid Pixel Shader (hr=0x8007000E): (null) [0eaded38] direct3d11 vout display error: Failed to create the pixel shader. (hr=0x80070057) [0eaded38] direct3d11 vout display error: Failed to allocate format resources [0eaded38] direct3d11 vout display error: Direct3D11 could not be opened [0eaded38] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 [0eaded38] direct3d9 vout display error: Could not read adapter capabilities. (hr=0x8876086a) [0eaded38] direct3d9 vout display error: Direct3D9 could not be opened [0eaded38] direct3d9 vout display error: SetThumbNailClip failed: 0x800706f4 [0eaded38] glwin32 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadd2d0] direct3d11 vout display error: invalid Pixel Shader (hr=0x8007000E): (null) [0eadd2d0] direct3d11 vout display error: Failed to create the pixel shader. (hr=0x80070057) [0eadd2d0] direct3d11 vout display error: Failed to allocate format resources [0eadd2d0] direct3d11 vout display error: Direct3D11 could not be opened [0eadd2d0] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadd2d0] direct3d9 vout display error: Could not read adapter capabilities. (hr=0x8876086a) [0eadd2d0] direct3d9 vout display error: Direct3D9 could not be opened [0eadd2d0] direct3d9 vout display error: SetThumbNailClip failed: 0x800706f4 [1e96af68] d3d11va generic error: Could not Query ID3D11VideoDevice Interface. (hr=0x80004002) [1e96af68] d3d11va generic error: CreateVideoService failed [0eadd2d0] glwin32 vout display error: SetThumbNailClip failed: 0x800706f4 [0eade108] direct3d11 vout display error: invalid Pixel Shader (hr=0x8007000E): (null) [0eade108] direct3d11 vout display error: Failed to create the pixel shader. (hr=0x80070057) [0eade108] direct3d11 vout display error: Failed to allocate format resources [0eade108] direct3d11 vout display error: Direct3D11 could not be opened [0eade108] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 [0eade108] direct3d9 vout display error: Could not read adapter capabilities. (hr=0x8876086a) [0eade108] direct3d9 vout display error: Direct3D9 could not be opened [0eade108] direct3d9 vout display error: SetThumbNailClip failed: 0x800706f4 [1f610640] direct3d9 generic error: Could not read adapter capabilities. (hr=0x8876086a) [1e96a548] dxva2 generic error: Could not read adapter capabilities. (hr=0x8876086a) [1e96a548] dxva2 generic error: IDirect3D9_CreateDevice failed [1e96a548] dxva2 generic error: Failed to create device [0eade108] glwin32 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadeb30] direct3d11 vout display error: invalid Pixel Shader (hr=0x8007000E): (null) [0eadeb30] direct3d11 vout display error: Failed to create the pixel shader. (hr=0x80070057) [0eadeb30] direct3d11 vout display error: Failed to allocate format resources [0eadeb30] direct3d11 vout display error: Direct3D11 could not be opened [0eadeb30] direct3d11 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadeb30] direct3d9 vout display error: Could not read adapter capabilities. (hr=0x8876086a) [0eadeb30] direct3d9 vout display error: Direct3D9 could not be opened [0eadeb30] direct3d9 vout display error: SetThumbNailClip failed: 0x800706f4 [0eadeb30] glwin32 vout display error: SetThumbNailClip failed: 0x800706f4 程序“[9888] Ai.FMS.exe”已退出,返回值为 -1 (0xffffffff)。

c#
winforms
loops
vlc
asked on Stack Overflow Dec 11, 2019 by limy • edited Dec 11, 2019 by Venkata Shivaram

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0