[vlc-commits] direct3d11: fix the pixel per channel for multi planar formats

Steve Lhomme git at videolan.org
Thu Feb 15 16:04:24 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Feb 15 15:26:29 2018 +0100| [51142e1f09f6a78f99aeba43a1e39255e4027065] | committer: Steve Lhomme

direct3d11: fix the pixel per channel for multi planar formats

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=51142e1f09f6a78f99aeba43a1e39255e4027065
---

 modules/video_output/win32/direct3d11.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index f3643d73ea..4979783c57 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1627,7 +1627,9 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt)
         default:
             {
                 const vlc_chroma_description_t *p_format = vlc_fourcc_GetChromaDescription(fmt->i_chroma);
-                bits_per_channel = p_format == NULL || p_format->pixel_bits == 0 ? 8 : p_format->pixel_bits / p_format->pixel_size;
+                bits_per_channel = p_format == NULL ||
+                                   p_format->pixel_bits == 0 ? 8 : p_format->pixel_bits /
+                                                               (p_format->plane_count==1 ? p_format->pixel_size : 1);
             }
             break;
         }



More information about the vlc-commits mailing list