Windows Media Format SDK banner art
PreviousNext

IWMReader::Start

The Start method starts reading from the specified starting time offset. Uncompressed data is passed to IWMReaderCallback::OnSample.

Syntax

HRESULT Start(
  QWORD  cnsStart,
  QWORD  cnsDuration,
  float  fRate,
  void*  pvContext
);
Parameters

  cnsStart

[in]  Specifies the start position in 100-nanosecond units.  If cnsStart is set to WM_START_CURRENTPOSITION then playback will start from the current position; otherwise, the playback position will seek to the specified position.

  cnsDuration

[in]  Specifies the duration of the read in 100-nanosecond units.  If this is set to zero, it will play to the end of the file.

  fRate

[in]  Floating point number indicating rate.  1.0 is full-speed playback, higher numbers are faster, and lower numbers are slower. Numbers less than zero indicate reverse rate (rewinding).

  pvContext

[in]  Universal pointer to the context  This context is passed to the user on calls to IWMReaderCallback..

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Meaning
E_OUTOFMEMORY There is not enough available memory.
E_UNEXPECTED The method failed for an unspecified reason.

Remarks

To change the rate but not the current file position, use the Start method with the WM_START_CURRENTPOSITION value.  Any call to Start while paused will be treated as a "seek" through the file, and will incur a buffering penalty from network files. This is true even for calls to Start with the WM_START_CURRENTPOSITION value.  If you want to continue playing from the current paused position with no buffering penalty, call Resume.

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.