Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.95 KB

to-seek-to-markers.md

File metadata and controls

53 lines (38 loc) · 2.95 KB
title description ms.assetid keywords ms.topic ms.date ms.custom
To Seek to Markers
To Seek to Markers
2d5efebf-dcbd-4fb8-933e-cc6d3a99adf8
Advanced Systems Format (ASF),seeking to markers
ASF (Advanced Systems Format),seeking to markers
Advanced Systems Format (ASF),asynchronous readers
ASF (Advanced Systems Format),asynchronous readers
Advanced Systems Format (ASF),markers
ASF (Advanced Systems Format),markers
asynchronous readers,seeking to markers
asynchronous readers,markers
markers,seeking
markers,asynchronous readers
article
4/26/2023
UpdateFrequency5

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.

Related topics

Markers

Reading Files with the Asynchronous Reader

Working with Indexes