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

Steve Lhomme git at videolan.org
Wed Oct 17 16:07:27 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Dec  1 14:55:28 2017 +0100| [9b57d135d242f269dcf0fad7ca578c788a57fd31] | committer: Steve Lhomme

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

And remove dead code

(cherry picked from commit 7d5ab2a61b905b58cb12776f49888aa47995001d)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9b57d135d242f269dcf0fad7ca578c788a57fd31
---

 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 152f90c168..c4f6acb129 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1318,14 +1318,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;
@@ -1347,6 +1341,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