Page 1 of 1

chapter variable is not updated on lua cli

Posted: 22 Feb 2014 08:52
by nokangaroo
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:

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
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.

Re: chapter variable is not updated on lua cli

Posted: 22 Feb 2014 12:58
by Etoh
That seems like an annoying bug. If it is not fixed in the latest nightly (and not already reported) then you may want to submit a ticket to the VLC bug tracker: https://trac.videolan.org/vlc/

Re: chapter variable is not updated on lua cli

Posted: 24 Feb 2014 08:58
by nokangaroo
I find that a bug has already been reported (#9981). It is "unlikely to be fixed before 2.2.0". So we have to wait. I guess we can close this.

Re: chapter variable is not updated on lua cli

Posted: 24 Feb 2014 12:32
by Etoh
I find that a bug has already been reported (#9981). It is "unlikely to be fixed before 2.2.0". So we have to wait. I guess we can close this.
The bug has been reported, but you might want to update it to specifically mention your particular use case (i.e. setting the chapter via a LUA script) as it differs from the other user cases specifically mentioned (i.e. setting via main menu and setting via the time slider).