From a6f661b5c7620225a86b8d687433b229ce6f2132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 31 Aug 2023 18:56:02 +0200 Subject: player/command: fix video-params/[average-bpp, alpha] when hw decoding Need to check hw_subfmt for real values. --- player/command.c | 5 +++-- 1 file 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]); -- cgit v1.2.3