[vlc-commits] dxa9: clean code

Steve Lhomme git at videolan.org
Thu Nov 23 10:16:52 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Nov 22 18:18:25 2017 +0100| [12b76b3f9d5155a31e3184b5590dd839ca7cd820] | committer: Jean-Baptiste Kempf

dxa9: clean code

Use local variables when possible

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/hw/d3d9/dxa9.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 9b8ea161e2..93095ca055 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -372,14 +372,13 @@ static int OpenFromCPU( vlc_object_t *obj )
         return VLC_EGENERIC;
     }
 
-    video_format_Init(&fmt_staging, 0);
     D3DSURFACE_DESC texDesc;
     IDirect3DSurface9_GetDesc( peek->p_sys->surface, &texDesc);
-    vlc_fourcc_t d3d_fourcc = texDesc.Format;
-    if (d3d_fourcc == 0)
+    if (texDesc.Format == 0)
         goto done;
 
-    if ( p_filter->fmt_in.video.i_chroma != d3d_fourcc )
+    video_format_Init(&fmt_staging, 0);
+    if ( p_filter->fmt_in.video.i_chroma != texDesc.Format )
     {
         picture_resource_t res;
         res.pf_destroy = DestroyPicture;
@@ -390,7 +389,7 @@ static int OpenFromCPU( vlc_object_t *obj )
         }
 
         video_format_Copy(&fmt_staging, &p_filter->fmt_out.video);
-        fmt_staging.i_chroma = d3d_fourcc;
+        fmt_staging.i_chroma = texDesc.Format;
         fmt_staging.i_height = texDesc.Height;
         fmt_staging.i_width  = texDesc.Width;
 



More information about the vlc-commits mailing list