Code Monkey home page Code Monkey logo

Comments (10)

glubsy avatar glubsy commented on June 3, 2024 1

glualint is a validator for a specific variant of lua used in the half-life mod 'gmod'

@dfaker ah, that makes sense. Shame on me for not noticing that. Thanks for the heads-up.

from vr-reversal.

dfaker avatar dfaker commented on June 3, 2024

If you have placed the lua script in your scripts directory then it'll be auto loaded, no need to also pass the --script or --script-opts parameters, simply press 'v' to switch on the vr-reversal mode.

from vr-reversal.

openwick avatar openwick commented on June 3, 2024

yes I kept the lua file and conf file in scripts folder and I run it wiith mpv filename.mp4 now. Still getting this error

Can't load unknown script: /home/wick/.config/mpv/scripts/360plugin.conf
[360plugin] 
[360plugin] stack traceback:
[360plugin] 	[C]: ?
[360plugin] 	[C]: ?
[360plugin] Lua error: [string "/home/wick/.config/mpv/scripts/360plugin.lua"]:563: '=' expected near 'continue'
 (+) Video --vid=1 (*) (h264 1440x720 59.940fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1440x720 yuv420p
AV: 00:00:11 / 00:44:37 (0%) A-V:  0.000 Dropped: 7 Cache: 265s/150MB

from vr-reversal.

dfaker avatar dfaker commented on June 3, 2024

I don't use the script opts but I think the conf file just goes in a the /home/wick/.config/mpv/script-opts folder or omit it entirely.

Otherwise line 563 in 360plugin.lua looks perfectly fine to me, and doesn't contain an = in the repo are we certain it's a fresh accurate copy?

from vr-reversal.

glubsy avatar glubsy commented on June 3, 2024

@openwick what version of mpv are you running?

I have not looked into it further, but perhaps something changed in the expected lua syntax.

from vr-reversal.

openwick avatar openwick commented on June 3, 2024

@glubsy I am user 0.34 here is the full info

mpv 0.34.0 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       56.70.100
   libavcodec      58.134.100
   libavformat     58.76.100
   libswscale      5.9.100
   libavfilter     7.110.100
   libswresample   3.9.100
FFmpeg version: 4.4.1

still the script is not working

from vr-reversal.

glubsy avatar glubsy commented on June 3, 2024

It really seems like the lua parser has had some kind of patch applied to it.
What operating system is this? Can you post the lua version installed (type lua -v)?

You could try changing these lines to this, and it might work:
line 563 and line 584: change goto continue to continue,
line 570 and line 587: delete the line with ::continue::.

Even then it might not really work and you'll get another error. This online checker initially gave me error Line 563: unexpected continue expecting indexation or function call, but after I removed the goto statements and kept only "continue", oddly enough the errors disappeared.

In lua 5.4 here on Arch Linux, by toying around with this simple test I got syntax error near 'end' at line 6:

i = 0
while i < 20 do
        i = i + 1
        if i % 2 == 0 then
                continue
        end
end

Whereas the usual goto + ::label:: version works just fine.

I'm not sure how lua is implemented in mpv, but it seems they are using the lua headers from the operating system. So either you are running a patched version of lua, or mpv has some kind of patch going on. Not sure yet.

from vr-reversal.

openwick avatar openwick commented on June 3, 2024

HI @glubsy sorry for the late reply.
I am running lua version 5.4.3 on Fedora 35 as the output of lua -v is this

Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio

I changed the lines as you mentioned but I am getting the same error. Still getting the same error

[360plugin] Lua error: [string "/home/wick/.config/mpv/scripts/360plugin.lua"]:564: '=' expected near 'end'

Just for reference here are those for loops from 560 to 590 with changes as you mentioned. I also moved the continue one tab inside just to see if it works but it didn't :(

local restore_props = function()
	for k, v in pairs(saved_props) do
		if v == "NIL" then
			continue
		end
		if k == "hwdec" then
			-- Can also be displayed in osd console with "show-text ${hwdec-current}"
			mp.osd_message(string.format("Restoring hardware acceleration: %s", v), 1.5)
		end
		mp.set_property(k, v)
	end

	for k, _ in pairs(saved_props) do
		saved_props[k] = "NIL"
	end
end

local restore_keybinds = function()
	-- There is no need to re-apply the previous key-bindings if they have been
	-- forcibly rebound by our script. They are still there after removal.
	for k,v in pairs(bindings) do
		if k == binding_by_name("toggle_vr360") then
			print("Keeping key bind to toggle vr360: " .. k)
			continue
		end
		mp.remove_key_binding(v["name"])
	end
end

from vr-reversal.

dfaker avatar dfaker commented on June 3, 2024

Even then it might not really work and you'll get another error. This online checker initially gave me error Line 563: unexpected continue expecting indexation or function call, but after I removed the goto statements and kept only "continue", oddly enough the errors disappeared.

continue isn't a keyword in standard lua, glualint is a validator for a specific variant of lua used in the half-life mod 'gmod' which rather unluckily does include a continue keyword but even their own docs advise against using it https://wiki.facepunch.com/gmod/Specific_Operators .

Your original goto label method seems to be the best way in standard lua.

from vr-reversal.

dfaker avatar dfaker commented on June 3, 2024

Could not reproduce, all indications are an issue with the lua interpreter in the users mpv build.

from vr-reversal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.