Skip to content

Lua 64-bit integer support

In VLC 3.0 the time is changed to microseconds, which means vlc/src/misc/variables.c will set values above 2147483647 (~35 minutes or 2148 seconds) to 0.

Example Lua code that will erroneously set time to 0 seconds:

vlc.var.set("time",2148000000)

Potentially relevant is line 99 of /src/input/input_internal.h

int64_t:     i_time;     /* Current time */

Also, potentially relevant is /src/misc/variables.c line 217-226:

        case VLC_VAR_INTEGER:
            if ((var->i_type & VLC_VAR_HASSTEP) && var->step.i_int
             && (val->i_int % var->step.i_int))
                val->i_int = (val->i_int + (var->step.i_int / 2))
                           / var->step.i_int * var->step.i_int;
            if ((var->i_type & VLC_VAR_HASMIN) && val->i_int < var->min.i_int)
               val->i_int = var->min.i_int;
            if ((var->i_type & VLC_VAR_HASMAX) && val->i_int > var->max.i_int)
                val->i_int = var->max.i_int;
            break;

The solution might be to change it to a float, though I don't know if that will cause other issues regarding precision.

For more details see: https://github.com/Syncplay/syncplay/pull/109

Edited by Pierre Ynard
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information