chapter variable is not updated on lua cli
Posted: 22 Feb 2014 08:52
This is a bug I ran into while experimenting with a shell script that parses the
vlc logfile to read values into variables.
(The script is here: http://www.linuxquestions.org/questions ... ost5121479 .
Feel free to play around with it; it sometimes even works. Any additions to it
will be posted there).
This post is about the lua interface though. I made the following alteration to
cli.lua and recompiled /usr/lib/vlc/lua/intf/cli.luac (I'm on Arch). The change
does not affect the bug; it just gives debug info:
Now if I type "chapter 1" on the lua commandline (chapters start with 0 for some
reason), the output is
ans_chapter=1
and the chapter will be switched. But typing "chapter" after this will give
ans_chapter=0 (should be ans_chapter=1)
so the chapter info is not updated. For this reason "chapter_n" also fails to
work - it also uses vlc.var.get( input, var ). Switching chapters with the
keyboard shortcut always works though, so the bug must be in the lua interface.
Any ideas how to fix it? I am not a programmer, and I am new to lua.
vlc logfile to read values into variables.
(The script is here: http://www.linuxquestions.org/questions ... ost5121479 .
Feel free to play around with it; it sometimes even works. Any additions to it
will be posted there).
This post is about the lua interface though. I made the following alteration to
cli.lua and recompiled /usr/lib/vlc/lua/intf/cli.luac (I'm on Arch). The change
does not affect the bug; it just gives debug info:
Code: Select all
function titlechap(name,client,value)
local input = vlc.object.input()
local var = string.gsub( name, "_.*$", "" )
if value then
vlc.var.set( input, var, value )
end
local item = vlc.var.get( input, var )
client:append("ans_" .. tostring(var) .. "=" .. item)
end
reason), the output is
ans_chapter=1
and the chapter will be switched. But typing "chapter" after this will give
ans_chapter=0 (should be ans_chapter=1)
so the chapter info is not updated. For this reason "chapter_n" also fails to
work - it also uses vlc.var.get( input, var ). Switching chapters with the
keyboard shortcut always works though, so the bug must be in the lua interface.
Any ideas how to fix it? I am not a programmer, and I am new to lua.