0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

f_decoder_wrapper: change video-codec to show description or name

Not both of them. Formating it as `<name> (<desc>)` produced arguably
silly string like `hevc (HEVC (High Efficiency Video Coding))`. Unpack
this to show only description if available or name otherwise. Produces
way nicer results in stats.lua and similar places where this name is
printed.
This commit is contained in:
Kacper Michajłow 2023-09-01 03:15:10 +02:00 committed by Niklas Haas
parent c4f0b24deb
commit 72536cce62
2 changed files with 3 additions and 2 deletions

View File

@ -99,6 +99,7 @@ Interface changes
- deprecate `--demuxer-cue-codepage` in favor of `--metadata-codepage`
- change the default of `metadata-codepage` to `auto`
- add `playlist-next-playlist` and `playlist-prev-playlist` commands
- change `video-codec` to show description or name, not both
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.

View File

@ -450,8 +450,8 @@ static bool reinit_decoder(struct priv *p)
p->decoder = driver->create(p->decf, p->codec, sel->decoder);
if (p->decoder) {
pthread_mutex_lock(&p->cache_lock);
p->decoder_desc =
talloc_asprintf(p, "%s (%s)", sel->decoder, sel->desc);
const char *d = sel->desc && sel->desc[0] ? sel->desc : sel->decoder;
p->decoder_desc = talloc_strdup(p, d);
MP_VERBOSE(p, "Selected codec: %s\n", p->decoder_desc);
pthread_mutex_unlock(&p->cache_lock);
break;