mirror of
https://github.com/mpv-player/mpv
synced 2025-04-17 04:40:09 +00:00
stats: minor simplification
This commit is contained in:
parent
3dbd031da0
commit
89c854dc09
@ -111,7 +111,10 @@ function add_video(s)
|
|||||||
end
|
end
|
||||||
if append_property(s, sec, "fps", {prefix="FPS:", suffix=" (specified)"}) then
|
if append_property(s, sec, "fps", {prefix="FPS:", suffix=" (specified)"}) then
|
||||||
append_property(s, sec, "estimated-vf-fps",
|
append_property(s, sec, "estimated-vf-fps",
|
||||||
{suffix=" (estimated)", nl="", indent=o.kv_sep, prefix_sep=""})
|
{suffix=" (estimated)", nl="", indent=""})
|
||||||
|
else
|
||||||
|
append_property(s, sec, "estimated-vf-fps",
|
||||||
|
{prefix="FPS:", suffix=" (estimated)"})
|
||||||
end
|
end
|
||||||
if append_property(s, sec, "video-params/w", {prefix="Native Resolution:"}) then
|
if append_property(s, sec, "video-params/w", {prefix="Native Resolution:"}) then
|
||||||
append_property(s, sec, "video-params/h",
|
append_property(s, sec, "video-params/h",
|
||||||
@ -159,7 +162,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
-- Format and append a property.
|
-- Format and append a property.
|
||||||
-- A property whose value is either `nil` or empty is skipped and not appended.
|
-- A property whose value is either `nil` or empty (hereafter called "invalid")
|
||||||
|
-- is skipped and not appended.
|
||||||
-- Returns `false` in case nothing was appended, otherwise `true`.
|
-- Returns `false` in case nothing was appended, otherwise `true`.
|
||||||
--
|
--
|
||||||
-- s : Table containing key `sec`.
|
-- s : Table containing key `sec`.
|
||||||
@ -168,8 +172,8 @@ end
|
|||||||
-- attr : Optional table to overwrite certain (formatting) attributes for
|
-- attr : Optional table to overwrite certain (formatting) attributes for
|
||||||
-- this property.
|
-- this property.
|
||||||
-- exclude : Optional table containing keys which are considered invalid values
|
-- exclude : Optional table containing keys which are considered invalid values
|
||||||
-- for this property, therefore skipping it. This will replace empty
|
-- for this property. Specifying this will replace empty string as
|
||||||
-- string as default invalid value (nil is always invalid).
|
-- default invalid value (nil is always invalid).
|
||||||
function append_property(s, sec, prop, attr, excluded)
|
function append_property(s, sec, prop, attr, excluded)
|
||||||
excluded = excluded or {[""] = true}
|
excluded = excluded or {[""] = true}
|
||||||
local ret = mp.get_property_osd(prop)
|
local ret = mp.get_property_osd(prop)
|
||||||
|
Loading…
Reference in New Issue
Block a user