Commit d83af090 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

access:dshow: fix crash when opening dshow:// fails

The MTA is never acquired but it's released on CommonClose(). So we acquire it
early.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent e77202ea
......@@ -659,12 +659,6 @@ 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;
}
......@@ -683,6 +677,12 @@ static int DemuxOpen( vlc_object_t *p_this )
ComContext ctx( COINIT_MULTITHREADED );
if( vlc_mta_acquire( p_this ) == false )
{
msg_Err( p_this, "Failed to acquire MTA" );
return VLC_EGENERIC;
}
if( CommonOpen( p_this, p_sys, true ) != VLC_SUCCESS )
{
CommonClose( p_this, p_sys );
......@@ -790,6 +790,12 @@ static int AccessOpen( vlc_object_t *p_this )
ComContext ctx( COINIT_MULTITHREADED );
if( vlc_mta_acquire( p_this ) == false )
{
msg_Err( p_this, "Failed to acquire MTA" );
return VLC_EGENERIC;
}
if( CommonOpen( p_this, p_sys, false ) != VLC_SUCCESS )
{
CommonClose( p_this, p_sys );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment