Partager via


IAsyncReader2::SetCurrentPosition (Compact 2013)

3/26/2014

This method sets the position of the first requested sample in the media stream.

Syntax

HRESULT SetCurrentPosition(
  LONGLONG lOffset
);

Parameters

  • lOffset
    [in] Offset, in bytes, of the first requested media sample.

Return Value

Returns the HRESULT values shown in the following table.

Value

Description

E_FAIL

The position was not set.

VFW_E_BADALIGN

An invalid alignment was specified.

S_OK

The position was set.

Remarks

You must set the offset of the requested media sample based on the properties of the streamer i.e. the streamer supports time based seeking allocator. To retrieve the source properties, call IAsyncReader2::GetCapabilities. If the allocator is based on time streamer supports time-based seeking, set the offset from the start time of the stream and set the time in the IAsyncReader2::SetCurrentTime method. If the allocator is based on position streamer supports byte-based seeking, set the offset in bytes from the start of the stream.

You can retrieve the sample from this position by calling IAsyncReader2::GetNext.

Requirements

Header

dshow.h

Library

Strmiids.lib

See Also

Reference

IAsyncReader2 Interface