feat: include future secondary subtitle overlaps - #177
Conversation
a96890e to
928ad11
Compare
|
Extracting a subtitle file from a video can take a few seconds and requires resources, so until now we didn't want to implement it in mpvacious. Plus, it requires writing a lot of code. Before settling on this solution, let's try a proven method. In our sub-transition script we look ahead by changing for secondary subs, use the |
|
Implemented the |
89c24f9 to
eea9b58
Compare
|
I think I should try using this for a few days before it becomes reviewable |
|
I think I have to make it handle backwards subtitle overlaps as well, because sometimes I jump into the middle of a primary cue and mpvacious doesn't see a backward secondary cue |
|
Simply rewinding back and forth is enough for mpvacious to memorize subtitle lines. shift+h and shift+l are mentioned in README as aliases for seek back and seek forward. |
Okay, I'll roll back the change |
7412daf to
6ddc4f8
Compare
6ddc4f8 to
81ca880
Compare
|
Removed the backwards seek |
sub-step is a pretty clever hack that can be applied in both directions if you actually need it. My comment was more about whether this is something the users might need or not. You can probably edit scan_secondary_forward() to include direction as a parameter, so you don't have to duplicate much code. Also, consider splitting this PR into smaller ones if possible. Please comment when this PR is ready. |
Why
The subtitle observer only knows secondary cues that mpv has already displayed. If the selected primary subtitle window extends beyond the current playback position, later secondary cues that overlap that window are missing from both the card and its OSD preview.
What changed
sub-step 1 secondaryinstead of parsing or extracting the subtitle track.secondary-sub-delayandaudio-delay.secondary-sub-delayafter lookahead, including when stepping fails.This performs no file I/O and launches no subprocess. For embedded tracks, lookahead is naturally limited to cues inside mpv's subtitle prefetch range.
Verification
luajit tests/run.lua