Export (0) Print
Expand All

IMediaSeeking::GetDuration method

The GetDuration method gets the duration of the stream.

Syntax


HRESULT GetDuration(
  [out] LONGLONG *pDuration
);

Parameters

pDuration [out]

Receives the duration, in units of the current time format.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method gets the duration of the stream at normal playback speed. Changing the playback rate does not affect the duration.

The duration is expressed in the current time format. The default time format is REFERENCE_TIME units (100 nanoseconds). To change time formats, use the IMediaSeeking::SetTimeFormat method.

Depending on the source format, the duration might not be exact. For example, if the source contains a variable bit-rate (VBR) stream, the method might return an estimated duration.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

See also

Error and Success Codes
IMediaSeeking Interface

 

 

Community Additions

ADD
Show:
© 2015 Microsoft