Commit 69477405 authored by Adrien Maglo's avatar Adrien Maglo Committed by Thomas Guillem
Browse files

transcode: destroy the mutex and condition only if they have been initialized.



If i_threads == 0, both are not initialized as the function transcode_video_new
returns before the call to vlc_mutex_init and vlc_cond_init.

This patch fixes a deadlock on vlc_cond_destroy called with an uninitialized
condition variable argument.
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 4f5af4a4
......@@ -589,8 +589,11 @@ void transcode_video_close( sout_stream_t *p_stream,
block_ChainRelease( p_stream->p_sys->p_buffers );
}
vlc_mutex_destroy( &p_stream->p_sys->lock_out );
vlc_cond_destroy( &p_stream->p_sys->cond );
if( p_stream->p_sys->i_threads >= 1 )
{
vlc_mutex_destroy( &p_stream->p_sys->lock_out );
vlc_cond_destroy( &p_stream->p_sys->cond );
}
/* Close decoder */
if( id->p_decoder->p_module )
......
Supports Markdown
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