[vlc-commits] direct3d9: Don't attempt to use hardware conversion for uneven dimensions
Hugo Beauzée-Luyssen
git at videolan.org
Wed Apr 5 19:31:02 CEST 2017
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Apr 5 09:40:56 2017 +0200| [c2970f6aea95f801ea3435d37f479cfd70035d95] | committer: Hugo Beauzée-Luyssen
direct3d9: Don't attempt to use hardware conversion for uneven dimensions
Even when an even buffer is used, StretchRect seems to be failing to
convert the last column, at least on some devices.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2970f6aea95f801ea3435d37f479cfd70035d95
---
modules/video_output/win32/direct3d9.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index f190e65..e2264f9 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1040,6 +1040,7 @@ static const d3d_format_t d3d_formats[] = {
static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target)
{
vout_display_sys_t *sys = vd->sys;
+ bool hardware_scale_ok = !(vd->fmt.i_visible_width & 1) && !(vd->fmt.i_visible_height & 1);
for (unsigned pass = 0; pass < 2; pass++) {
const vlc_fourcc_t *list;
@@ -1047,7 +1048,7 @@ static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t c
if (pass == 0 && is_d3d9_opaque(chroma))
list = dxva_chroma;
- else if (pass == 0 && sys->allow_hw_yuv && vlc_fourcc_IsYUV(chroma))
+ else if (pass == 0 && hardware_scale_ok && sys->allow_hw_yuv && vlc_fourcc_IsYUV(chroma))
list = vlc_fourcc_GetYUVFallback(chroma);
else if (pass == 1)
list = vlc_fourcc_GetRGBFallback(chroma);
More information about the vlc-commits
mailing list