void SavePlaybackHintsToMovie(FSSpecPtr movieFile)
{
Movie movie = NULL;
Track track = NULL;
short resRefNum = 0;
short resId = movieInDataForkResID;
Str255 resName;
OSErr err;
err = OpenMovieFile( movieFile, &resRefNum, fsWrPerm );
if (err != noErr) goto bailError;
err = NewMovieFromFile( &movie, resRefNum,
&resId, resName, newMovieActive, NULL );
if (err != noErr) goto bailError;
/* get the first video track */
track = GetMovieIndTrackType( movie, 1,
VisualMediaCharacteristic,
movieTrackCharacteristic | movieTrackEnabledOnly );
if ( track == NULL ) goto bailError;
/* save the play hints with the movie */
SetTrackLoadSettings( track, 0, 0, 0, hintsHighQuality );
err = GetMoviesError();
if (err != noErr) goto bailError;
/* save our changes to the movie */
err = UpdateMovieResource( movie,
resRefNum, movieInDataForkResID, resName );
if ( movie != NULL )
{
DisposeMovie( movie );
}
if ( resRefNum != 0 )
{
CloseMovieFile( resRefNum );
}
bailError:
;
}
|