SampleNumToMediaTime
TheSampleNumToMediaTimefunction allows you to find the time at which a specified sample plays. This time is expressed in the media's time scale.
pascal void SampleNumToMediaTime (Media theMedia, long logicalSampleNum, TimeValue *sampleTime, TimeValue *sampleDuration);
theMedia- Specifies the media for this operation. You obtain this media identifier from such Movie Toolbox functions as
NewTrackMediaandGetTrackMedia(described on page 2-138 and page 2-190, respectively).logicalSampleNum
Specifies the sample number.sampleTime- Contains a pointer to a time value. The
MediaTimeToSampleNumfunction updates this time value to indicate the starting time of the sample specified by thelogicalSampleNumparameter. This time value is expressed in the media's time scale. Set this parameter tonilif you do not want this information.sampleDuration- Contains a pointer to a time value. The Movie Toolbox returns the duration of the sample specified by the
logicalSampleNumparameter. This time value is expressed in the media's time scale. Set this parameter tonilif you do not want this information.ERROR CODES
invalidMedia -2008 This media is corrupted or invalid SEE ALSO
You can find the sample for a specified time by calling theMediaTimeToSampleNumfunction, which is described in the previous section.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help