[vlc-commits] dshow: Use vlc_mta_holder

Hugo Beauzée-Luyssen git at videolan.org
Mon Jun 26 13:27:17 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jun 12 17:12:11 2017 +0200| [14bbab92a011da687cea5623681632f5daabe9e4] | committer: Hugo Beauzée-Luyssen

dshow: Use vlc_mta_holder

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

 modules/access/dshow/dshow.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index ec8c8ec0cc..d16efba490 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -52,6 +52,8 @@
 #include "access.h"
 #include "filter.h"
 
+#include "../src/win32/mta_holder.h"
+
 #define INSTANCEDATA_OF_PROPERTY_PTR(x) ((PKSPROPERTY((x))) + 1)
 #define INSTANCEDATA_OF_PROPERTY_SIZE(x) (sizeof((x)) - sizeof(KSPROPERTY))
 
@@ -658,6 +660,12 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
 
     if( p_sys->pp_streams.empty() ) return VLC_EGENERIC;
 
+    if( vlc_mta_acquire( p_this ) == false )
+    {
+        msg_Err( p_this, "Failed to acquire MTA" );
+        return VLC_EGENERIC;
+    }
+
     return VLC_SUCCESS;
 }
 
@@ -822,6 +830,8 @@ 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 );
 
+    vlc_mta_release( p_this );
+
     free( p_sys );
 }
 



More information about the vlc-commits mailing list