Skip to content

Commit

Permalink
utils/libav: Only adjust bit_shift for DRM P010 frames
Browse files Browse the repository at this point in the history
Fixes mapping Vulkan P010 frames.

Closes #237
  • Loading branch information
nowrep authored and haasn committed Jan 29, 2024
1 parent 9e3cc45 commit a5e7010
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/include/libplacebo/utils/libav_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,6 @@ static void pl_fix_hwframe_sample_depth(struct pl_frame *out, const AVFrame *fra
struct pl_bit_encoding *bits = &out->repr.bits;

bits->sample_depth = fmt->component_depth[0];

switch (hwfc->sw_format) {
case AV_PIX_FMT_P010: bits->bit_shift = 6; break;
default: break;
}
}

static bool pl_map_avframe_drm(pl_gpu gpu, struct pl_frame *out,
Expand Down Expand Up @@ -1016,6 +1011,12 @@ static bool pl_map_avframe_drm(pl_gpu gpu, struct pl_frame *out,
}

pl_fix_hwframe_sample_depth(out, frame);

switch (hwfc->sw_format) {
case AV_PIX_FMT_P010: out->repr.bits.bit_shift = 6; break;
default: break;
}

return true;
}

Expand Down

0 comments on commit a5e7010

Please sign in to comment.