[vlc-commits] direct3d11: only look for a suitable decoder format when we need to

Steve Lhomme git at videolan.org
Mon May 28 13:25:21 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Dec  1 14:55:28 2017 +0100| [7d5ab2a61b905b58cb12776f49888aa47995001d] | committer: Steve Lhomme

direct3d11: only look for a suitable decoder format when we need to

And remove dead code

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

 modules/video_output/win32/direct3d11.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index cce934f369..811282a4de 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1292,14 +1292,8 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt)
     // look for the requested pixel format first
     sys->picQuad.formatInfo = GetDirectRenderingFormat(vd, fmt->i_chroma);
 
-    /* look for a decoder format that can be decoded but not used in shaders */
-    const d3d_format_t *decoder_format = NULL;
-    if ( !sys->picQuad.formatInfo && is_d3d11_opaque(fmt->i_chroma) )
-        decoder_format = GetDirectDecoderFormat(vd, fmt->i_chroma);
-    else
-        decoder_format = sys->picQuad.formatInfo;
-
     // look for any pixel format that we can handle with enough pixels per channel
+    const d3d_format_t *decoder_format = NULL;
     if ( !sys->picQuad.formatInfo )
     {
         uint8_t bits_per_channel;
@@ -1323,6 +1317,12 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt)
             break;
         }
 
+        /* look for a decoder format that can be decoded but not used in shaders */
+        if ( is_d3d11_opaque(fmt->i_chroma) )
+            decoder_format = GetDirectDecoderFormat(vd, fmt->i_chroma);
+        else
+            decoder_format = sys->picQuad.formatInfo;
+
         bool is_rgb = !vlc_fourcc_IsYUV(fmt->i_chroma);
         sys->picQuad.formatInfo = GetDisplayFormatByDepth(vd, bits_per_channel, decoder_format!=NULL, is_rgb);
         if (!sys->picQuad.formatInfo && is_rgb)



More information about the vlc-commits mailing list