37 lines · 1003 B · Lua
RawDownload
-- Test a float property which internally uses NaN.-- Run with --no-config (or just scale-param1 not set). local utils = require 'mp.utils' local prop_name = "scale-param1" -- internal NaN, return string "default" instead of NaNlocal v = mp.get_property_native(prop_name, "fail")print("Exp:", "string", "\"default\"")print("Got:", type(v), utils.to_string(v)) v = mp.get_property(prop_name)print("Exp:", "default")print("Got:", v) -- not representable -> return provided fallback valuev = mp.get_property_number(prop_name, -100)print("Exp:", -100)print("Got:", v) mp.set_property_native(prop_name, 123)v = mp.get_property_number(prop_name, -100)print("Exp:", "number", 123)print("Got:", type(v), utils.to_string(v)) -- try to set an actual NaNlocal st, msg = mp.set_property_number(prop_name, 0.0/0)print("Exp:", nil, "<message>")print("Got:", st, msg) -- set defaultmp.set_property(prop_name, "default") v = mp.get_property(prop_name)print("Exp:", "default")print("Got:", v)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t