Browse Source

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 <thomas@gllm.fr>
pull/43/head
Adrien Maglo 10 years ago
committed by Thomas Guillem
parent
commit
6947740598
  1. 7
      modules/stream_out/transcode/video.c

7
modules/stream_out/transcode/video.c

@ -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 )

Loading…
Cancel
Save