Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using DSPack, SetPosition plays the entire clip. Correct usage?

46 views
Skip to first unread message

Raymond Kennington

unread,
Jul 15, 2008, 11:01:54 PM7/15/08
to
A clip (QuickTime .MOV) was displayed initially using:

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.

Raymond Kennington

unread,
Jul 15, 2008, 11:33:37 PM7/15/08
to
Further information:

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.

0 new messages