ADC Home > Reference Library > Technical Q&As > QuickTime > Carbon >

Using QTSetAtomData


Q: I'm using QTSetAtomData to modify some atom data, but I'd like to know what this call does with the atomData pointer being passed to it.

A: QTSetAtomData is used to change the data of a leaf atom. It copies the number of bytes passed in as dataSize from the address atomData to the contents of atom. It will resize the atom if necessary.

OSErr QTSetAtomData(QTAtomContainer container,
                    QTAtom          atom,
                    long            dataSize,
                    void            *atomData)

When using this function be aware that the position (offset) of any atoms within the QTAtomContainer greater than the passed in QTAtom will need to be re-found using QTFindChildByID or QTFindChildByIndex. Also, the passed in QTAtomContainer must be unlocked; this call will fail if you've locked the atom container by calling QTLockAtomContainer.

Note that an atom is either a parent, or a leaf containing data. It cannot be both. Make sure to not call QTSetAtomData with an atom that has any child atoms contained within it.

References:


[Jan 14 2003]


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.