chapter variable is not updated on lua cli

Discuss your Lua playlist, album art and interface scripts.
nokangaroo
Blank Cone
Blank Cone
Posts: 29
Joined: 30 Dec 2010 17:11

chapter variable is not updated on lua cli

Postby nokangaroo » 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:

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.

Etoh
Blank Cone
Blank Cone
Posts: 60
Joined: 12 Jan 2013 16:33

Re: chapter variable is not updated on lua cli

Postby Etoh » 22 Feb 2014 12:58

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/

nokangaroo
Blank Cone
Blank Cone
Posts: 29
Joined: 30 Dec 2010 17:11

Re: chapter variable is not updated on lua cli

Postby nokangaroo » 24 Feb 2014 08:58

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.

Etoh
Blank Cone
Blank Cone
Posts: 60
Joined: 12 Jan 2013 16:33

Re: chapter variable is not updated on lua cli

Postby Etoh » 24 Feb 2014 12:32

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


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 11 guests