ADC Home > Reference Library > Technical Q&As > Legacy Documents > QuickTime >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

NewMovieFromScrap, Adding the Media Later

Q When my application creates a new media (of text type in this case) for a new track in a movie created with NewMovieFromScrap, the dataRef and dataRefType should be set to nil, according to the QuickTime documentation. The problem is that later I want to edit that media (adding a text sample to it, for example), but BeginMediaEdits returns the noDataHandler error (no data handler found). I assume I can get around that by first saving the movie to a file, but this seems slimy since the movie won't end up on disk in the end. Any suggestions for a better approach?

A You're correct -- BeginMediaEdits complains if the movie has been created with NewMovieFromScrap. Unfortunately, BeginMediaEdits doesn't think memory-based movies are on a media that will support editing. The workaround is to store the movie in a temporary file until you're finished editing it.

When you call NewTrackMedia, pass an alias to a new file in the dataRef parameter instead of nil. Passing nil (the usual approach) indicates that the movie's default data reference should be used, but because your movie came from the scrap and not a file, it has no data reference -- hence the error you're getting. By the way, using the handle data handler in QuickTime 2.0 you can create a movie entirely in memory.

[May 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.