To Seek to Markers

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

A marker is a named location in an ASF file. You can only start playback from the location of a marker by using the asynchronous reader. You can begin playback at a marker by following these steps.

  1. Call IWMReader::QueryInterface to obtain a pointer to the IWMHeaderInfo interface.
  2. Retrieve the total number of markers in the file by calling IWMHeaderInfo::GetMarkerCount.
  3. Loop through the markers, using the marker count retrieved in step 2. Retrieve the name and time of each marker by calling IWMHeaderInfo::GetMarker for each. Save the index of the desired marker.
  4. Call IWMReader::QueryInterface to obtain a pointer to the IWMReaderAdvanced2 interface.
  5. Specify the marker at which to start playback by calling IWMReaderAdvanced2::StartAtMarker. You must pass the index of the desired marker, which you saved in step 3.
  6. Handle the samples as you normally would in your implementation of the IWMReaderCallback::OnSample method.

Markers

Reading Files with the Asynchronous Reader

Working with Indexes