那好办,如下:
procedure TFormPlayWin.Button1Click(Sender: TObject);
var
ms: IMediaSeeking;
StopPosition, CurrentPosition: int64;
begin
FilterGraph.Stop;
if Succeeded(FilterGraph.QueryInterface(IID_IMediaSeeking, ms)) then
begin
ms.GetStopPosition(StopPosition);
CurrentPosition := 0 * 10000000;
// 0 可以修改为其他以 毫秒 为单位的时音
ms.SetPositions(CurrentPosition, AM_SEEKING_AbsolutePositioning,
StopPosition, AM_SEEKING_NoPositioning);
end;
FilterGraph.Play;
end;
或者不用 Stop/Play,直接设置 Position 就可以了。