我的播放代码如下
function TForm5.Play_File(MPG_FILE_PATH:string):byte;
begin
try
FilterGraph.Active := False;
FilterGraph.ClearGraph;
FilterGraph.Active := true;
FilterGraph.RenderFile(MPG_FILE_PATH);
FilterGraph.Play;
StartStreaming;
except
end;
end;procedure TForm5.FilterGraphGraphComplete(sender: TObject; Result: HRESULT;
Renderer: IBaseFilter);
begin
try
if FilterGraph.Active then FilterGraph.Active := false;
except
end;
end;然后我用一个Timer1 来时时判断影片是否播放完成完完成就继续用Play_File来播放下一个影片。可是每次他播放下一个影片时都会出错!请大家帮帮忙。
function TForm5.Play_File(MPG_FILE_PATH:string):byte;
begin
try
FilterGraph.Active := False;
FilterGraph.ClearGraph;
FilterGraph.Active := true;
FilterGraph.RenderFile(MPG_FILE_PATH);
FilterGraph.Play;
StartStreaming;
except
end;
end;procedure TForm5.FilterGraphGraphComplete(sender: TObject; Result: HRESULT;
Renderer: IBaseFilter);
begin
try
if FilterGraph.Active then FilterGraph.Active := false;
except
end;
end;然后我用一个Timer1 来时时判断影片是否播放完成完完成就继续用Play_File来播放下一个影片。可是每次他播放下一个影片时都会出错!请大家帮帮忙。
不过我是把文件分成一小段一小段的播放,播放第一段就正常,播放后面的就在
FilterGraph.stop 或 FilterGraph.clearGraph处程序停顿了 也不知错在那里
望能得到帮助 [email protected]