Skip to content

Commit

Permalink
add a section about nested chapters and the order or chapter commands
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Aug 27, 2021
1 parent 724e010 commit cace8dc
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions chapter_codecs.md
Expand Up @@ -6,6 +6,34 @@ title: Chapter Codecs

*TODO*

# Matroska Chapter Codecs and Nested Chapters

When `Nested Chapters` contain chapters codecs -- via the `ChapProcess` Element --
the enter/leave commands -- ChapProcessTime Element -- **MUST** be executed in a specific order,
if the Matroska Player supports the chapter codecs included in the chapters.

When starting playback, the `Matroska Player` **MUST** start at the `ChapterTimeStart` of the first chapter of the ordered chapter.
The enter commands of that chapter **MUST** be executed.
If that chapter contains `Nested Chapters`, the enter commands of the `Nested Chapter` with the same `ChapterTimeStart` **MUST** be executed.
If that chapter contains `Nested Chapters`, the enter commands of the `Nested Chapter` with the same `ChapterTimeStart` **MUST** be executed,
and so on until there is no `Nested Chapter` with the same `ChapterTimeStart`.

When switching from a chapter to another:

* the leave commands (`ChapProcessTime`=2) of the
chapter **MUST** be executed, then the leave commands of its parent chapter, etc. until the
common `Parent Chapter` or `Edition` element. The leave command of that `Parent Chapter` or `Edition` element
**MUST NOT** be executed.
* the enter commands (`ChapProcessTime`=1) of the `Nested Chapter` of the common `Parent Chapter` or `Edition` element,
to reach the chapter we switch to, **MUST** be executed, then the enter commands of its `Nested Chapter`
to reach the chapter we switch to **MUST** be executed, until that chapter is the chapter we switch to.
The enter commands of that chapter **MUST** be executed as well.

When the last Chapter finished playing -- i.e. its `ChapterTimeEnd` has been reached --
the `Matroska Player` **MUST** execute its leaved commands, then the leave commands of it's `Parent Chapter`,
until the parent of the chapter is the Edition.


## Matroska Script (0)

This is the case when `ChapProcessCodecID` = 0\. This is a script language build for
Expand Down

0 comments on commit cace8dc

Please sign in to comment.