summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/mp_image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 7e0dd173b7..5e2726fd3a 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -614,7 +614,8 @@ void mp_image_set_attributes(struct mp_image *image,
// the colorspace as implied by the pixel format.
void mp_image_params_guess_csp(struct mp_image_params *params)
{
- struct mp_imgfmt_desc fmt = mp_imgfmt_get_desc(params->imgfmt);
+ int imgfmt = params->hw_subfmt ? params->hw_subfmt : params->imgfmt;
+ struct mp_imgfmt_desc fmt = mp_imgfmt_get_desc(imgfmt);
if (!fmt.id)
return;
if (fmt.flags & MP_IMGFLAG_YUV) {