1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-19 22:36:55 +00:00

select.lua: strip trailing zeros from FPS values

Show e.g. "30 fps" instead of "30.000 fps".

Also switch to %.4f for consistency with pretty_print_double().
This commit is contained in:
Guido Cella 2024-05-14 20:10:11 +02:00 committed by Kacper Michajłow
parent 78b2de677b
commit b82d437ea4

View File

@ -61,7 +61,8 @@ local function format_track(track)
(track["demux-w"] and track["demux-w"] .. "x" .. track["demux-h"]
.. " " or "") ..
(track["demux-fps"] and not track.image
and string.format("%.3f", track["demux-fps"]) .. " fps " or "") ..
and string.format("%.4f", track["demux-fps"]):gsub("%.?0*$", "") ..
" fps " or "") ..
(track["demux-channel-count"] and track["demux-channel-count"] ..
" ch " or "") ..
(track["codec-profile"] and track.type == "audio"