但是播放视频文件时,在renderfile那里就出错
报错是:
“System.Runtime.InteropServices.COMException”类型的未经处理的异常出现在 DSPlayer.exe 中。
其他信息: 异常来自 HRESULT:0x80040216
怎么解决啊,求大神帮忙
public void selectIndexChanged(){
fName = Convert.ToString(listBox1.SelectedItem);
fName = fPath + "\\" + fName;
playMedia(fName);
}
private void playMedia(String fName) {
cleanUp();
m_objFilterGraph = new FilgraphManager();
m_objFilterGraph.RenderFile(fName);
m_objBasicAudio = (IBasicAudio)m_objFilterGraph;
m_objBasicVideo = (IBasicVideo)m_objFilterGraph;
try
{
m_objVideoWindow = (IVideoWindow)m_objFilterGraph;
m_objVideoWindow.Owner = (int)splitContainer1.Panel1.Handle;
m_objVideoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;
m_objVideoWindow.SetWindowPosition(splitContainer1.Panel1.ClientRectangle.Left, splitContainer1.Panel1.Top, m_objBasicVideo.VideoWidth, m_objBasicVideo.VideoHeight);
splitContainer1.Height = m_objBasicVideo.VideoHeight + panel1.Height;
splitContainer1.Width = m_objBasicVideo.VideoWidth + splitContainer1.Panel2.Width + 4;
}
catch (Exception)
{
m_objVideoWindow = null;
}
2 个解决方案
#1
为什么啊?有没有人啊
#2
Directshow不支持wmv和avi之外的格式播放 除非自己添加相关的解码器
#1
为什么啊?有没有人啊
#2
Directshow不支持wmv和avi之外的格式播放 除非自己添加相关的解码器