Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The default subtitle offset in VLC player (Windows) is 50ms (hotkey is G/H). I would prefer to have it much greater (such as 500ms or 1s).

Is there a way to configure that value (without recompiling) (Preferences or registry) ?

EDIT:

Actually, I found the code that handles this offset (and yes it is hard-coded):

modules/control/hotkeys.c

        else if( i_action == ACTIONID_SUBDELAY_DOWN )
        {
            int64_t i_delay = var_GetTime( p_input, "spu-delay" );
            i_delay -= 50000;    /* 50 ms */
            var_SetTime( p_input, "spu-delay", i_delay );
            ClearChannels( p_intf, p_vout );
            DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
                            _( "Subtitle delay %i ms" ),
                            (int)(i_delay/1000) );
        }
        else if( i_action == ACTIONID_SUBDELAY_UP )
        {
            int64_t i_delay = var_GetTime( p_input, "spu-delay" );
            i_delay += 50000;    /* 50 ms */
            var_SetTime( p_input, "spu-delay", i_delay );
            ClearChannels( p_intf, p_vout );
            DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
                            _( "Subtitle delay %i ms" ),
                             (int)(i_delay/1000) );
        }

I am now trying to locate this piece of code in the executable, but I have no clue on how to do this. Any help ?

I also looked at the other option that is to recompile all the stuff, but I definitively gave up on this one (on windows)...

share|improve this question
add comment

1 Answer

If you click G or H couple of times, it'll increase it. Press 10 times the button, then you'll have 500ms. Check if holding the key make the difference. Or if you can increase that value in the Keyboard Shortcuts.

Hardcore way: You can download Hex Workshop, TSearch or any other hex editor which can attach to the process, find which value which is increasing every 50ms and try to change it. Once you find the right place, there should be also pointer to the address by which value (50ms) it was changed. Once you find that in memory, you can easily change it in EXE file permanently. Sounds easy:)

share|improve this answer
    
My request is actually to have a 500ms shift with 1 hit. I often come to the point where I have to shift for 10 seconds! This is not a valid answer, but thanxs for trying ;-) –  Christophe Aug 1 '12 at 8:10
    
Can you check if holding the key for longer does work? Have you check in the keyboard shortcuts that you can't change it? –  kenorb Aug 1 '12 at 8:19
    
I already looked into the preferences in order to modify the keyboard shortcuts, but I did not find anything. Furthermore, I'm open to the hardcore way, but I need some guidance - I cannot think I can easily find the constant that is added to the current subtitle "playhead" when hitting a key... If you have some knowledge how to accomplish that, I am interested! –  Christophe Aug 1 '12 at 12:13
    
I played with it time ago, now I'm on Mac, so it'll not work. Basically change the offset to e.g. 250ms, attach to the process and find that value (you'll have thousands of them, change again to 350ms, find 350 within those which had previously 250, increase the value again, again and again, until you'll find one or two values in the memory, this is your offset in memory (you can change as you want). But now the question is, which memory has this 50ms. So then you have to find the option, if there is any, by code/memory changed that value. –  kenorb Aug 1 '12 at 12:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.