Skip to content

Commit cd1ce43

Browse files
committed
update
1 parent 0dae9fe commit cd1ce43

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

portable_config/script-opts.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
script-opts-append = console-exact_match=no # <no|yes> 是否启用精确搜索匹配。如果不使用此选项,在查询前加上半角符号 ' (单引号)可临时启用精确匹配。
2929
script-opts-append = console-case_sensitive=no # <no|yes> 区分大小写(用于精确搜索匹配)
3030
script-opts-append = console-background_alpha=80 # <0-255> select菜单背景的透明度。默认 80
31+
script-opts-append = console-gap=0.2 # select菜单的条目之间的间距
3132
script-opts-append = console-padding=10 # select菜单内边距
3233
script-opts-append = console-menu_outline_size=0 # select菜单边框粗细
3334
script-opts-append = console-menu_outline_color="#FFFFFF" # select菜单边框颜色,格式为 "#RRGGBB" ,示例即默认值

portable_config/script-opts/console.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ case_sensitive=no
3131
##区分大小写(用于精确搜索匹配)
3232
background_alpha=80
3333
##<0-255> select菜单背景的透明度。默认 80
34+
gap=0.2
35+
##select菜单的条目之间的间距
3436
padding=10
3537
##select菜单内边距
3638
menu_outline_size=0

portable_config/scripts/stats.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--[[
22
SOURCE_ https://github.com/mpv-player/mpv/blob/master/player/lua/stats.lua
3-
COMMIT_ 5b1df3c5d900298e433539c99e8e5ea60acfa068
3+
COMMIT_ 0fb40b654d969b2447ae0f71bcb695d7cf597f9c
44
文档_ stats.conf
55
66
mpv.conf的前置条件 --load-stats-overlay=no
@@ -889,30 +889,33 @@ local function append_hdr(s, hdr, video_out)
889889
return
890890
end
891891

892-
local function should_show(val)
893-
return val and val ~= 203 and val > 0
892+
local function has(val, target)
893+
return val and math.abs(val - target) > 1e-4
894894
end
895895

896896
-- If we are printing video out parameters it is just display, not mastering
897897
local display_prefix = video_out and "显示:" or "母版显示:"
898898

899899
local indent = ""
900+
local has_dml = has(hdr["min-luma"], 0.203) or has(hdr["max-luma"], 203)
901+
local has_cll = hdr["max-cll"] and hdr["max-cll"] > 0
902+
local has_fall = hdr["max-fall"] and hdr["max-fall"] > 0
900903

901-
if should_show(hdr["max-cll"]) or should_show(hdr["max-luma"]) then
904+
if has_dml or has_cll or has_fall then
902905
append(s, "", {prefix="HDR10:"})
903-
if hdr["min-luma"] and should_show(hdr["max-luma"]) then
906+
if has_dml then
904907
-- libplacebo uses close to zero values as "defined zero"
905908
hdr["min-luma"] = hdr["min-luma"] <= 1e-6 and 0 or hdr["min-luma"]
906909
append(s, format("%.2g / %.0f", hdr["min-luma"], hdr["max-luma"]),
907910
{prefix=display_prefix, suffix=" cd/m²", nl="", indent=indent})
908911
indent = o.prefix_sep .. o.prefix_sep
909912
end
910-
if should_show(hdr["max-cll"]) then
911-
append(s, hdr["max-cll"], {prefix="MaxCLL:", suffix=" cd/m²", nl="",
912-
indent=indent})
913+
if has_cll then
914+
append(s, string.format("%.0f", hdr["max-cll"]), {prefix="MaxCLL:",
915+
suffix=" cd/m²", nl="", indent=indent})
913916
indent = o.prefix_sep .. o.prefix_sep
914917
end
915-
if hdr["max-fall"] and hdr["max-fall"] > 0 then
918+
if has_fall then
916919
append(s, hdr["max-fall"], {prefix="MaxFALL:", suffix=" cd/m²", nl="",
917920
indent=indent})
918921
end
@@ -1076,9 +1079,9 @@ local function add_video(s)
10761079
end
10771080

10781081
local track = mp.get_property_native("current-tracks/video")
1079-
if track then
1080-
append(s, "", {prefix=track.image and "图片:" or "视频轨:", nl=o.nl .. o.nl, indent=""})
1081-
append(s, track["codec-desc"], {prefix_sep="", nl="", indent=""})
1082+
local track_type = (track and track.image) and "图片:" or "视频轨:"
1083+
append(s, "", {prefix=track_type, nl=o.nl .. o.nl, indent=""})
1084+
if track and append(s, track["codec-desc"], {prefix_sep="", nl="", indent=""}) then
10821085
append(s, track["codec-profile"], {prefix="[", nl="", indent=" ", prefix_sep="",
10831086
no_prefix_markup=true, suffix="]"})
10841087
if track["codec"] ~= track["decoder"] then

0 commit comments

Comments
 (0)