You can also use QTSMediaSetInfo. Here's my code to set the delay. Kevin,
what are the advantages of using the Presentation API, and what are the
units of the delay (ie, how long is 1 << 16)?
--Brian
I find delay values like 1 << 16, 1 << 15, and 3 << 16 seem to work well.
// In this function, theMovie may be held when the movie is opened
bool SetDelay(Movie theMovie, Fixed delayValue) {
Track theTrack;
theTrack = GetMovieIndTrackType(
theMovie,
1, // The "Index" value to be returned by GetMovieIndTrackType
kQTSStreamMediaType, // The type.
movieTrackMediaType); // The calling method.
if ((int)theTrack == -50) { // paramErr
printf("Invalid Parameter to SetBufferDelay.");
return false;
}
else if ((int)theTrack == -2010) {
printf("Invalid Movie in SetBufferDelay.");
return false;
}
else if ((int)theTrack == -2028) {
printf("Invalid track in SetBufferDelay.");
return false;
}
// Otherwise, we have a track.
Media theMedia;
theMedia = GetTrackMedia(theTrack);
if ((int)theMedia == -2009) {
printf("Invalid Track.");
return false;
}
MediaHandler theMediaHandler;
theMediaHandler = GetMediaHandler(theMedia);
if ((int)theMediaHandler == -2008) {
printf("Invalid Media passed to GetMediaHandler");
return false;
}
ComponentResult c;
c = QTSMediaSetInfo(theMediaHandler, kQTSTargetBufferDurationInfo,
&delayValue);
return true;
}
---------------------------
Brian Rosenthal
Chief Technology Officer
XCiteMedia, Inc.
email@hidden