BeginMediaEdits
TheBeginMediaEditsfunction starts a media-editing session.
pascal OSErr BeginMediaEdits (Media theMedia);
theMedia- Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as
NewTrackMediaandGetTrackMedia(described on page 2-138 and page 2-190, respectively).DESCRIPTION
You use theBeginMediaEditsfunction to notify the Movie Toolbox that you are going to add sample data to a media. In response, the Movie Toolbox determines whether the media can be updated. For example, if the media data are stored on disk, the Movie Toolbox opens the disk file with write permissions. If the media is stored on a read-only storage medium, such as a CD-ROM disc, the Movie Toolbox does not start an editing session and returns an error.Use the
EndMediaEditsfunction, which is described in the next section, to end a media-editing session.You must call
BeginMediaEditsbefore you add samples to a media with theAddMediaSamplefunction (described on page 2-256). Under some circumstances, you must start a media-editing session before calling theInsertTrackSegmentfunction (described on page 2-246).ERROR CODES
File system errors
invalidMedia -2008 This media is corrupted or invalid