Skip to content

Commit

Permalink
player/command: fix video-params/[average-bpp, alpha] when hw decoding
Browse files Browse the repository at this point in the history
Need to check hw_subfmt for real values.
  • Loading branch information
kasper93 authored and jeeb committed Mar 7, 2024
1 parent d471f29 commit a6f661b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down

0 comments on commit a6f661b

Please sign in to comment.