I noticed what may be unintended behavior regarding files whose first chapter does not begin at 0:00.
When the first chapter starts later in the file, MPV exposes an implicit unnamed chapter from 0:00 until the first chapter marker.
It appears that SmartSkip classifies this implicit chapter using the title of the first named chapter.
Reproduction
Example chapter layout:
00:05:08 Opening Credits
00:06:16 Chapter 01
00:51:51 End Credits
Configuration:
categories=[["internal-chapters","opening>^Opening"]]
skip=[["internal-chapters","opening"]]
Observed behavior
Playback begins at 0:00.
Instead of playing until Opening Credits and then skipping that chapter, SmartSkip immediately skips the unnamed lead-in section before the first chapter.
With bulk skip disabled, this happens as two consecutive skips.
With bulk skip enabled, both skips are combined into one operation.
The OSD shows:
● Auto-Skip
➤ Chapter (0)
➤ Chapter (1) Opening Credits
Relevant code
The behavior seems related to this special case:
if i == 0 and chapters[i+1] and matches(i, chapters[i+1].title) then
This appears to evaluate the implicit chapter 0 using the title of the first named chapter.
Expected behavior
I would expect the implicit chapter before the first named chapter to remain independent, with only chapters whose own title (or explicitly configured index rule) matches a skip category being skipped.
This is particularly noticeable for movies, where the content before the opening credits is often part of the film and not something users necessarily want skipped simply because the following chapter is named "Opening Credits".
Additional question
This also made me wonder about the intended semantics of idx->0.
Should idx->0 refer to:
- the implicit unnamed lead-in chapter created by MPV, or
- the first actual chapter defined in the media?
Since the implicit chapter is handled specially here, it's not immediately obvious how index-based rules are intended to map to MPV's chapter numbering.
Possible improvement
If the current behavior is not intentional, would it make sense to remove the special handling for i == 0 and evaluate only actual chapter entries?
if chapters[i] and matches(i, chapters[i].title) then
That would allow the lead-in before the first chapter to play normally while still skipping the actual "Opening Credits" chapter, and would also make index-based matching easier to reason about.
If the current behavior is intentional, I'd be interested in understanding the rationale, since I may be misunderstanding how the implicit chapter is expected to behave.
I noticed what may be unintended behavior regarding files whose first chapter does not begin at
0:00.When the first chapter starts later in the file, MPV exposes an implicit unnamed chapter from
0:00until the first chapter marker.It appears that SmartSkip classifies this implicit chapter using the title of the first named chapter.
Reproduction
Example chapter layout:
Configuration:
Observed behavior
Playback begins at
0:00.Instead of playing until Opening Credits and then skipping that chapter, SmartSkip immediately skips the unnamed lead-in section before the first chapter.
With bulk skip disabled, this happens as two consecutive skips.
With bulk skip enabled, both skips are combined into one operation.
The OSD shows:
Relevant code
The behavior seems related to this special case:
This appears to evaluate the implicit chapter 0 using the title of the first named chapter.
Expected behavior
I would expect the implicit chapter before the first named chapter to remain independent, with only chapters whose own title (or explicitly configured index rule) matches a skip category being skipped.
This is particularly noticeable for movies, where the content before the opening credits is often part of the film and not something users necessarily want skipped simply because the following chapter is named "Opening Credits".
Additional question
This also made me wonder about the intended semantics of
idx->0.Should
idx->0refer to:Since the implicit chapter is handled specially here, it's not immediately obvious how index-based rules are intended to map to MPV's chapter numbering.
Possible improvement
If the current behavior is not intentional, would it make sense to remove the special handling for
i == 0and evaluate only actual chapter entries?That would allow the lead-in before the first chapter to play normally while still skipping the actual "Opening Credits" chapter, and would also make index-based matching easier to reason about.
If the current behavior is intentional, I'd be interested in understanding the rationale, since I may be misunderstanding how the implicit chapter is expected to behave.