[vlc-commits] directx_va: merge local functions only called once

Steve Lhomme git at videolan.org
Tue Jun 13 15:00:43 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon May 29 14:12:36 2017 +0200| [32ee9e75dabf2ee9d52902eaa7f9bf12d665cc25] | committer: Jean-Baptiste Kempf

directx_va: merge local functions only called once

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

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

 modules/codec/avcodec/directx_va.c | 34 ++++++++--------------------------
 1 file changed, 8 insertions(+), 26 deletions(-)

diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 914e3a4536..52bee538a7 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -262,9 +262,6 @@ static const directx_va_mode_t DXVA_MODES[] = {
 
 static int FindVideoServiceConversion(vlc_va_t *, directx_sys_t *, const es_format_t *fmt);
 static void DestroyVideoDecoder(vlc_va_t *, directx_sys_t *);
-static void DestroyVideoService(vlc_va_t *, directx_sys_t *);
-static void DestroyDeviceManager(vlc_va_t *, directx_sys_t *);
-static void DestroyDevice(vlc_va_t *, directx_sys_t *);
 
 char *directx_va_GetDecoderName(const GUID *guid)
 {
@@ -441,9 +438,14 @@ void directx_va_Release(vlc_va_surface_t *surface)
 void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys)
 {
     DestroyVideoDecoder(va, dx_sys);
-    DestroyVideoService(va, dx_sys);
-    DestroyDeviceManager(va, dx_sys);
-    DestroyDevice(va, dx_sys);
+    dx_sys->pf_destroy_video_service(va);
+    if (dx_sys->d3ddec)
+        IUnknown_Release(dx_sys->d3ddec);
+    if (dx_sys->pf_destroy_device_manager)
+        dx_sys->pf_destroy_device_manager(va);
+    dx_sys->pf_destroy_device(va);
+    if (dx_sys->d3ddev)
+        IUnknown_Release( dx_sys->d3ddev );
 
     if (dx_sys->hdecoder_dll)
         FreeLibrary(dx_sys->hdecoder_dll);
@@ -532,13 +534,6 @@ static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *
     return is_supported;
 }
 
-void DestroyVideoService(vlc_va_t *va, directx_sys_t *dx_sys)
-{
-    dx_sys->pf_destroy_video_service(va);
-    if (dx_sys->d3ddec)
-        IUnknown_Release(dx_sys->d3ddec);
-}
-
 /**
  * Find the best suited decoder mode GUID and render format.
  */
@@ -596,16 +591,3 @@ static int FindVideoServiceConversion(vlc_va_t *va, directx_sys_t *dx_sys, const
     p_list.pf_release(&p_list);
     return err;
 }
-
-void DestroyDeviceManager(vlc_va_t *va, directx_sys_t *dx_sys)
-{
-    if (dx_sys->pf_destroy_device_manager)
-        dx_sys->pf_destroy_device_manager(va);
-}
-
-void DestroyDevice(vlc_va_t *va, directx_sys_t *dx_sys)
-{
-    dx_sys->pf_destroy_device(va);
-    if (dx_sys->d3ddev)
-        IUnknown_Release( dx_sys->d3ddev );
-}



More information about the vlc-commits mailing list