Show the same flags in loadfile.c, select.lua and stats.lua. The only differences are that only stats.lua prints both image and albumart because it's supposed to show detailed track information, and select.lua prints the image flag because pressing g-v doesn't show Video or Image like in loadfile.c and stats.lua.
Showing the changes to player/lua/select.lua (1 of 3 files). Show all
Unified · Split
| @@ -62,6 +62,25 @@ mp.add_forced_key_binding(nil, "select-playlist", function () · 61 unmodified lines | |||
| 62 | }) | 62 | }) |
| 63 | end) | 63 | end) |
| 64 | 64 | ||
| 65 | local function format_flags(track) | ||
| 66 | local flags = "" | ||
| 67 | |||
| 68 | for _, flag in ipairs({ | ||
| 69 | "default", "forced", "dependent", "visual-impaired", "hearing-impaired", | ||
| 70 | "image", "external" | ||
| 71 | }) do | ||
| 72 | if track[flag] then | ||
| 73 | flags = flags .. flag .. " " | ||
| 74 | end | ||
| 75 | end | ||
| 76 | |||
| 77 | if flags == "" then | ||
| 78 | return "" | ||
| 79 | end | ||
| 80 | |||
| 81 | return " [" .. flags:sub(1, -2) .. "]" | ||
| 82 | end | ||
| 83 | |||
| 65 | local function format_track(track) | 84 | local function format_track(track) |
| 66 | return (track.selected and "●" or "○") .. | 85 | return (track.selected and "●" or "○") .. |
| 67 | (track.title and " " .. track.title or "") .. | 86 | (track.title and " " .. track.title or "") .. |
| @@ -78,9 +97,8 @@ local function format_track(track) · 10 unmodified lines | |||
| 78 | (track["codec-profile"] and track.type == "audio" | 97 | (track["codec-profile"] and track.type == "audio" |
| 79 | and track["codec-profile"] .. " " or "") .. | 98 | and track["codec-profile"] .. " " or "") .. |
| 80 | (track["demux-samplerate"] and track["demux-samplerate"] / 1000 .. | 99 | (track["demux-samplerate"] and track["demux-samplerate"] / 1000 .. |
| 81 | " kHz " or "") .. | 100 | " kHz " or "") |
| 82 | (track.external and "external " or "") | 101 | ):sub(1, -2) .. ")" .. format_flags(track) |
| 83 | ):sub(1, -2) .. ")" | ||
| 84 | end | 102 | end |
| 85 | 103 | ||
| 86 | mp.add_forced_key_binding(nil, "select-track", function () | 104 | mp.add_forced_key_binding(nil, "select-track", function () |