diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-08-31 18:56:02 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2024-03-07 21:12:12 +0200 |
commit | a6f661b5c7620225a86b8d687433b229ce6f2132 (patch) | |
tree | d44b96b4b0dfdac17ee56ddf80de8a2d16746244 | |
parent | d471f2902eb4f824fb5b62c3a30b26581d1e22b9 (diff) | |
download | mpv-a6f661b5c7620225a86b8d687433b229ce6f2132.tar.bz2 mpv-a6f661b5c7620225a86b8d687433b229ce6f2132.tar.xz |
player/command: fix video-params/[average-bpp, alpha] when hw decoding
Need to check hw_subfmt for real values.
-rw-r--r-- | player/command.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index 75debf781d..29ece5b7fb 100644 --- a/player/command.c +++ b/player/command.c @@ -2329,8 +2329,9 @@ static int property_imgparams(const struct mp_image_params *p, int action, void int bpp = 0; enum pl_alpha_mode alpha = p->repr.alpha; - if (p->imgfmt) { - struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(p->imgfmt); + int fmt = p->hw_subfmt ? p->hw_subfmt : p->imgfmt; + if (fmt) { + struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(fmt); for (int i = 0; i < desc.num_planes; i++) bpp += desc.bpp[i] >> (desc.xs[i] + desc.ys[i]); |