Microsoft DirectX 9.0

AMTimelineSrc.SetMediaTimes2 Method

The SetMediaTimes2 method sets the media stop and start times.


    Start As Double,
    Stop As Double



Media start time, in seconds.


Media stop time, in seconds.

Error Codes

If the method fails, an error is raised.


The media times are the stop and start times relative to the original media file. Always set the media times when you add a video or audio source to the timeline. Otherwise, rendering problems might occur. The stop time must be greater than the start time.

To use a still frame from a video source, set the stop time to a fractional amount more than the start time, such as 100 nanoseconds. Setting them to the same value causes a rendering error.

If the timeline duration does not match the media duration, the source stretches or shrinks accordingly. This causes the clip to play slower or faster than the authored rate (pitch shifting will occur in an audio source). For more information, see Time in DirectShow Editing Services.

You can specify the duration of the source file by calling the SetMediaLength method. If you set a media stop time that exceeds the duration, DES truncates the stop time.

See Also