[vlc-devel] Set subtitle delay to the next/previous subtitle line

Aurélien Aptel aurelien.aptel at gmail.com
Sat Jan 14 12:23:18 CET 2012


Hi,

VLC currently has only one way to change the subtitle delay: +/- 50ms
hotkeys (h and g) of via the synchronisation menu.
In mplayer there are hotkeys (g/y) to set the delay so that the
next/previous subtitle line is visible. Obviously it's only useful if
the subtitle fps matches the movie fps but it's really handy.

eg. you're watching a 1h video. The first subtitle text starts at 30mn
but it's not in sync: it's supposed to start at 27mn.
So instead of fiddling with the +-50ms keys you just hit "next
subtitle line" as soon the person at 27mn speaks.

I want to implement this feature in VLC. Since g/h is mapped to
-+50ms, I was thinking of mapping it to shift+g/shift+h in order to
have something intuitive.

I'm new to the VLC codebase but I've managed to locate and understand
the places to patch over the last few days. I'll post the patch when I
have something working for reviews, etc.
Which brings me to another question: what's the preferred way to
trigger something in a module from the ui? I have to modify some vars
from a demux_t->p_sys in modules/demux/subtitle.c



More information about the vlc-devel mailing list