vlc | branch: master | Steve Lhomme <rob...@videolabs.io> | Wed Nov 22 18:18:25 
2017 +0100| [3561f6bd61f289487843dcb41d244b91931d7c34] | committer: 
Jean-Baptiste Kempf

dxa9: clean code

Use local variables when possible

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 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;
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to