QueryInterface(IID_IMediaSeeking, MediaSeeking);
with MediaSeeking do
begin
SetTimeFormat(TIME_FORMAT_MEDIA_TIME);
GetAvailable(EarliestPos, LatestPos);
ShowMessage( 'Earliest Pos: ' + IntToStr(EarliestPos) + #13#10
+ 'Latest Pos: ' + IntToStr(LatestPos));
// Earliest: 0
// Latest : 7 660 000
StartPos := EarliestPos;
StopPos := LatestPos;
MediaSeeking.SetPositions(StartPos,AM_SEEKING_AbsolutePositioning,
StopPos, AM_SEEKING_AbsolutePositioning);
end;
Play();
The following code is an attempt to send the clip back to the beginning:
procedure TSearchForm.ToBeginningBtnClick(Sender: TObject);
begin
DisplayFilterGraph.Active := True;
with MediaSeeking do
begin
case SetPositions(EarliestPos, AM_SEEKING_AbsolutePositioning,
EarliestPos, AM_SEEKING_AbsolutePositioning) of
S_FALSE: ShowMessage('No position change. (Both flags specify no
seeking.)');
S_OK: ; // ShowMessage('Success.');
E_INVALIDARG: ShowMessage('Invalid argument.');
E_NOTIMPL: ShowMessage('Method is not supported.');
E_POINTER: ShowMessage('NULL pointer argument.');
end;
end;
end;
However, the entire clip is played.
What is the correct way of setting the absolute positions?
Thanks.
Raymond.
The return result of SetPositions is that of FALSE, namely no seeking
took place.
I have installed the klcodec codecs (using the default install).
Raymond.