History

loadfile: update the format of terminal track information

Stop making unselected tracks and editions grey because they can be hard to read over a dark background (\033[2m would be hard to differentiate from regular text with a light theme instead), and because there is no way to not print the escape sequences in --log-file. Just use the same circles as the OSD and OSC. We need to print the empty circles for alignment on mlterm with East Asian fonts (we could also make them invisible with \033[8m but it would still get added to log files). Add back the space before tracks and editions when printed after "Playing..." or "Track switched" and similar, so they look like a sub-section of it, consistently with the metadata which starts with space which makes it look like a sub-section of the "File tags" line. Leave 2 spaces between track columns. Make the lang options only as long as the longest language. Place hls-bitrate within the same parentheses as the other data. Replace the incomprehensible (*) (f) and [P] with textual descriptions within []. Also place external there. Stop converting Hz to kHz for consistency with other log messages, e.g. AO: [pipewire] 48000Hz stereo 2ch floatp Remove the space in "2 ch" so it doesn't look like 2 separate values (We considered using mp_chmap_to_str(&s->codec->channels) but it prints values like "unknown2").

Guido Cella committed 2 years ago

Commit 82ffe8f1 parent f7c14614 files · +50 −56Browse files

Showing the changes to player/lua/select.lua (1 of 4 files). Show all

Unified · Split

player/lua/select.lua+1−1
@@ -74,7 +74,7 @@ local function format_track(track) · 73 unmodified lines
74 and string.format("%.4f", track["demux-fps"]):gsub("%.?0*$", "") ..74 and string.format("%.4f", track["demux-fps"]):gsub("%.?0*$", "") ..
75 " fps " or "") ..75 " fps " or "") ..
76 (track["demux-channel-count"] and track["demux-channel-count"] ..76 (track["demux-channel-count"] and track["demux-channel-count"] ..
77 " ch " or "") ..77 "ch " or "") ..
78 (track["codec-profile"] and track.type == "audio"78 (track["codec-profile"] and track.type == "audio"
79 and track["codec-profile"] .. " " or "") ..79 and track["codec-profile"] .. " " or "") ..
80 (track["demux-samplerate"] and track["demux-samplerate"] / 1000 ..80 (track["demux-samplerate"] and track["demux-samplerate"] / 1000 ..

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