diff options
author | wm4 <wm4@nowhere> | 2017-02-21 10:34:26 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-21 10:34:26 +0100 |
commit | b258327210766ce7a040a075abf681b2130bb80b (patch) | |
tree | 6e89e07f15b24ab5e4b66c41e406a40d72594d7c /video/mp_image.c | |
parent | df30b217d9551749e02373b66bddd2f8787223cf (diff) | |
download | mpv-b258327210766ce7a040a075abf681b2130bb80b.tar.bz2 mpv-b258327210766ce7a040a075abf681b2130bb80b.tar.xz |
mp_image: for hwaccel, use underlying fmt in mp_image_params_guess_csp()
If imgfmt is a hwaccel format, hw_subfmt will contain the CPU equivalent
of the data stored in the hw frames.
Strictly speaking, not doing this was a bug, but since hwaccel formats
were tagged with MP_IMGFLAG_YUV, it didn't have much of an impact.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r-- | video/mp_image.c | 3 |
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) { |