Protected_The currently-held chapter list (may not yet be loaded from disk).
Protected_Whether chapters have been loaded from disk at least once.
Protected_Whether the in-memory chapter list differs from what is on disk.
Returns true if the in-memory chapter list has been modified.
Returns the held chapter list without triggering a disk read. Useful for mock implementations in tests.
Returns the chapter list, reading from disk on first call.
The MP4 file stream.
The chapter list (start times in ms).
Reads Nero chapters from the moov/udta/chpl atom.
The MP4 file stream.
true if a chpl atom was found and parsed.
Removes the chpl atom from the file (if present).
The MP4 file stream.
true on success (including when no chpl atom exists).
Writes the chapter list to disk only if it has been modified.
The file stream.
true if successful (or if no write was needed).
Updates the chapter list, marking it as modified if the new list differs from the current one or if the holder was not yet loaded.
Replacement chapter list.
Sets _modified directly (used in tests / mock subclasses).
New modified state.
Writes Nero chapters to the moov/udta/chpl atom, creating or replacing it.
Writing an empty list removes the chpl atom.
The MP4 file stream.
true on success.
Reads, writes, and removes Nero-style chapter markers (
chplatom atmoov/udta/chpl) from MP4 files.Implements the lazy-read / dirty-write pattern via Mp4ChapterHolder.
Example