Please try the following VLC extension script: Sampler, that I have made for VLC users and would like to make some more. Forum homepage: Sampler. It works quite well in VLC 1.1.11.
I am not able to make it work properly in new VLC2. If you set more than 1 sample, the second jump in time within an actual playlist item is not successful and VLC is blocked.
local input = vlc.object.input()...vlc.var.set(input, "time", samples_positions[actual_sample])
Please help. Thanks.
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Linked items
0
Link issues together to show that they're related.
Learn more.
Tested to work in VLC 2.0.5. The reason for the bug seems to be a change in src/input/var.c. It sends an "INPUT_EVENT_POSITION" event after setting the time, but not on setting position (that's why this one is still okay.
Line 634-638:
/* * Notify the intf that a new event has been occurred. * XXX this is a bit hackish but it's the only way to do it now. */ var_SetInteger( p_input, "intf-event", INPUT_EVENT_POSITION );
Therefore, setting the "time" from a button callback or the "main" routine is fine, but NOT from some piece of code called from within the input_events_handler (callback routine) or any other function called from within.
Not sure how to fix this in a clean way (was my first attempt to use lua).
Potential solutions:
Providing a separate playback.seek-function for lua which does not trigger a time/position event.
Avoid racing condition of events. Temporarily disable "interrupts"/block the second event while setting the time in the event handler (how?).
Something like a main loop to execute such commands outside the event.
The workaround really works. I am going to upload an update of Sampler. Thank you very much indeed.
Pierre Ynardchanged title from Lua: Jump to the second time position does not work to Lua: setting time from input events handler deadlocks
changed title from Lua: Jump to the second time position does not work to Lua: setting time from input events handler deadlocks
Pierre Ynardchanged title from Lua: setting time from input events handler deadlocks to Lua extensions: setting time from input events handler locks up
changed title from Lua: setting time from input events handler deadlocks to Lua extensions: setting time from input events handler locks up
Callbacks were removed from VLC Lua several years ago, so I have implemented a static solution in "sampler (PG).lua" (Playlist Generator generating playlist items having :start-time :stop-time options). It is not possible to write interesting extensions with automatic periodic activity (Sampler, Time, Subtitler, ...).