exeldro / obs-dynamic-delay

GNU General Public License v2.0
41 stars 4 forks source link

Typo in hot key registration (dynamic-delay.c) causes incorrect behavior. #3

Closed tinodo closed 3 years ago

tinodo commented 3 years ago

It appears as if there is a typo in the dynamic-delay.c source code:

static void dynamic_delay_load_hotkeys(void *data)
{
    struct dynamic_delay_info *d = data;
    obs_source_t *parent = obs_filter_get_parent(d->source);
    if (parent) {
        d->skip_begin_hotkey = obs_hotkey_register_source(
            parent, "skip_begin", obs_module_text("SkipBegin"),
            dynamic_delay_skip_begin_hotkey, data);
>>      d->skip_end_hotkey = obs_hotkey_register_source(
>>          parent, "skip_begin", obs_module_text("SkipEnd"),
>>          dynamic_delay_skip_end_hotkey, data);
        d->forward_hotkey = obs_hotkey_register_source(
            parent, "forward", obs_module_text("Forward"),
            dynamic_delay_forward_hotkey, data);
        d->forward_slow_hotkey = obs_hotkey_register_source(
            parent, "slow_forward", obs_module_text("SlowForward"),
            dynamic_delay_slow_forward_hotkey, data);
        d->forward_fast_hotkey = obs_hotkey_register_source(
            parent, "fast_forward", obs_module_text("FastForward"),
            dynamic_delay_fast_forward_hotkey, data);
        d->backward_hotkey = obs_hotkey_register_source(
            parent, "backward", obs_module_text("Backward"),
            dynamic_delay_backward_hotkey, data);
        d->backward_slow_hotkey = obs_hotkey_register_source(
            parent, "slow_backward",
            obs_module_text("SlowBackward"),
            dynamic_delay_slow_backward_hotkey, data);
        d->backward_fast_hotkey = obs_hotkey_register_source(
            parent, "fast_backward",
            obs_module_text("FastBackward"),
            dynamic_delay_fast_backward_hotkey, data);
        d->pause_hotkey = obs_hotkey_register_source(
            parent, "pause", obs_module_text("Pause"),
            dynamic_delay_pause_hotkey, data);
        d->hotkeys_loaded = true;
    }
}

It appears to me this should be:

d->skip_end_hotkey = obs_hotkey_register_source(
            parent, "skip_end", obs_module_text("SkipEnd"),
            dynamic_delay_skip_end_hotkey, data);

Highlighted:

d->skip_end_hotkey = obs_hotkey_registersource( parent, "skipend", obs_module_text("SkipEnd"), dynamic_delay_skip_end_hotkey, data);

This causes erratic behavior afaik.

I have created a new pull request for this change, but the build checks are failing (not related to the code).

Thanks!

Tino

tinodo commented 3 years ago

The new build (https://github.com/exeldro/obs-dynamic-delay/actions/runs/520155805) fixed the issue for me.

Thank you!!!