To Seek By Time Using the Asynchronous Reader
[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.]
If you want to seek to a specific presentation time in an ASF file, the file must be properly configured. You can seek in audio only files by default, but video files need to be indexed before seeking. If you are not sure about how a file has been created, you can check the g_wszWMSeekable attribute in the header of the file by calling IWMHeaderInfo::GetAttributeByName.
To seek to data in an ASF file by presentation time using the asynchronous reader, call IWMReader::Start, passing the desired time and duration of the part of the file you want to read as cnsStart and cnsDuration respectively.
Related topics