Skip to content

fix: use secondary delay for secondary subtitles - #182

Merged
tatsumoto-ren merged 2 commits into
Ajatt-Tools:masterfrom
kuator:fix/secondary-sub-delay
Sep 4, 2026
Merged

tatsumoto-ren merged 2 commits into
Ajatt-Tools:masterfrom
kuator:fix/secondary-sub-delay

Conversation

@kuator

@kuator kuator commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Problem

mpv has separate timing settings for primary and secondary subtitles:

  • sub-delay for the primary track
  • secondary-sub-delay for the secondary track

Mpvacious currently uses sub-delay when calculating the timing of both
tracks. When the two settings differ, the secondary subtitle is read at the
wrong time.

Example

Suppose the primary subtitle delay is 2 seconds and the secondary subtitle
delay is 1 second. Mpvacious currently shifts both tracks by 2 seconds, so the
secondary subtitle is off by 1 second.

After this change, the primary track is shifted by 2 seconds and the secondary
track by 1 second, matching what mpv displays.

Change

Use secondary-sub-delay when reading secondary subtitle timestamps. Primary
subtitles continue to use sub-delay.

Tests

Added a test where the primary and secondary delays are different. The full
test suite passes with luajit tests/run.lua.

@kuator

kuator commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

#177

@tatsumoto-ren
tatsumoto-ren merged commit 31ce1f1 into Ajatt-Tools:master Sep 4, 2026
@tatsumoto-ren

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants