[vlc-devel] [PATCH 2/2] dshow: Use vlc_mta_holder

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Jun 2 13:51:13 CEST 2017


---
 modules/access/dshow/access.h  | 4 ++++
 modules/access/dshow/dshow.cpp | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/modules/access/dshow/access.h b/modules/access/dshow/access.h
index c748f496ce..ccd2e849d4 100644
--- a/modules/access/dshow/access.h
+++ b/modules/access/dshow/access.h
@@ -26,6 +26,8 @@
  * Preamble
  *****************************************************************************/
 
+#include <vlc_threads.h>
+
 #include <dshow.h>
 
 #include <vector>
@@ -77,5 +79,7 @@ struct access_sys_t
     int            i_chroma;
     bool           b_chroma; /* Force a specific chroma on the dshow input */
     mtime_t        i_start;
+
+    vlc_mta_holder* p_mta;
 };
 
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index ec8c8ec0cc..4214a88430 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -658,6 +658,8 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
 
     if( p_sys->pp_streams.empty() ) return VLC_EGENERIC;
 
+    p_sys->p_mta = vlc_mta_acquire( p_this );
+
     return VLC_SUCCESS;
 }
 
@@ -822,6 +824,9 @@ static void CommonClose( vlc_object_t *p_this, access_sys_t *p_sys )
     vlc_mutex_destroy( &p_sys->lock );
     vlc_cond_destroy( &p_sys->wait );
 
+    if ( p_sys->p_mta )
+        vlc_mta_release( p_sys->p_mta );
+
     free( p_sys );
 }
 
-- 
2.11.0



More information about the vlc-devel mailing list