-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadfile: update the format of terminal track information #14405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer "2ch 48000Hz" but this addresses the important points
"2.0 48000Hz" is also okay but not used inside mpv otherwise
relevant PR #14192 (comment) |
Download the artifacts for this pull request: |
1246ee9
to
9320d6f
Compare
9320d6f
to
46129d8
Compare
46129d8
to
1eb9177
Compare
Do we want to merge the track data in one set of parentheses, or at least |
Could you make it more consistent? samplerate on ao does not use space but track does. Also codec profile only show up after track switched, so show them from very first or just remove it. |
|
1eb9177
to
b427a7a
Compare
Updated. Editions had issues because I've been modifying them blindly since I can't find any file with them so I don't think it's worth adding an option alias just for aligning them with tracks when they're so rare. |
Looks like this now
I'm fine with this. Let see what @sfan5 thinks though. |
Maybe use single spaces for editions? |
Ok for me. |
b427a7a
to
5e355f8
Compare
player/loadfile.c
Outdated
APPEND(b, " (external)"); | ||
if (t->default_track) | ||
APPEND(b, " (*)"); | ||
if (t->forced_track) | ||
APPEND(b, " (f)"); | ||
if (t->attached_picture) | ||
APPEND(b, " [P]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also instead of hieroglyphs, we could print it in full. Bit longer, but who know what [P]
means?
(default, external, picture)
for example, in most cases there are 1-2 flags per track.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think short form is fine for (*)
because it's so common
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is incomprehensible without reading the code though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simply document it in the manual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default
is not that long and there is plenty of space (excluding title, which may not fit anyway). I mean sure, we can make users read code/docs to see what (*) means, but how to you even search for this? And why explain output when we can make it self-explainable? No other media player does some cryptic flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with kasper, I don't see where you could even put in the docs.
5e355f8
to
2743ec1
Compare
print_stream(mpctx, mpctx->tracks[n]); | ||
print_stream(mpctx, mpctx->tracks[n], msg || | ||
mpctx->playlist->num_entries > 1 || | ||
mpctx->playing->playlist_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a comment would be good
067c6f0
to
9eb7f63
Compare
9eb7f63
to
8558112
Compare
8558112
to
90ac9fe
Compare
90ac9fe
to
f39c394
Compare
player/loadfile.c
Outdated
if (t->default_track || t->forced_track || t->attached_picture || | ||
t->visual_impaired_track || t->hearing_impaired_track || t->is_external) | ||
APPEND(b, " ["); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (t->default_track || t->forced_track || t->attached_picture || | |
t->visual_impaired_track || t->hearing_impaired_track || t->is_external) | |
APPEND(b, " ["); | |
if (t->default_track || t->forced_track || t->attached_picture || | |
t->visual_impaired_track || t->hearing_impaired_track || t->is_external) | |
{ | |
APPEND(b, " ["); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or even move it to first
check
APPEND(b, first ? " [" : ""); first = false;
can we maybe not make this into one mega-commit that changes everything all over again? there are clear problems with the current code that I would prefer to see fixed before the next round of bikesheddings. |
Which ones specifically? I though we are bikeshedding it from the beginning. |
f39c394
to
bf76144
Compare
Same, and the changes are already done. |
LGTM. I'm stopping here. I promise, I won't comment anymore. |
player/loadfile.c
Outdated
#define ADD_FLAG(b, flag, first) \ | ||
APPEND(b, " %s%s", first ? "[" : "", flag); \ | ||
first = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, last one.
Just small suggestion, wrap it in do while, so you don't accidentally forget about {}
. And if you do that, you can remove {}
from ifs below.
#define ADD_FLAG(b, flag, first) \ | |
APPEND(b, " %s%s", first ? "[" : "", flag); \ | |
first = false; | |
#define ADD_FLAG(b, flag) do { \ | |
APPEND(b, " %s%s", first ? "[" : "", flag); \ | |
first = false; \ | |
} while(0) |
(also removed first arg, we can assume it is there)
20cbfa9
to
50f8db1
Compare
The color handling regarding log file and depending on stdout state is objectively broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine otherwise
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").
50f8db1
to
d5b0d00
Compare
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 so they look like a sub-section of the "Playing..." line printed with playlists and of "Track switched", consistently with the metadata which starts with space which makes it look like a sub-section of the "File tags" line.
Also stop converting Hz to kHz for consistency with other log messages, e.g. AO: [pipewire] 48000Hz stereo 2ch floatp