Skip to content

Commit a4a43a8

Browse files
committed
transcode: avoid double thread join
1 parent e350259 commit a4a43a8

File tree

1 file changed

+4
-3
lines changed
  • modules/stream_out/transcode

1 file changed

+4
-3
lines changed

modules/stream_out/transcode/video.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,23 @@ static int transcode_video_encoder_open( sout_stream_t *p_stream,
576576
void transcode_video_close( sout_stream_t *p_stream,
577577
sout_stream_id_sys_t *id )
578578
{
579-
if( p_stream->p_sys->i_threads >= 1 )
579+
if( p_stream->p_sys->i_threads >= 1 && !p_stream->p_sys->b_abort )
580580
{
581581
vlc_mutex_lock( &p_stream->p_sys->lock_out );
582582
p_stream->p_sys->b_abort = true;
583583
vlc_cond_signal( &p_stream->p_sys->cond );
584584
vlc_mutex_unlock( &p_stream->p_sys->lock_out );
585585

586586
vlc_join( p_stream->p_sys->thread, NULL );
587-
vlc_mutex_destroy( &p_stream->p_sys->lock_out );
588-
vlc_cond_destroy( &p_stream->p_sys->cond );
589587

590588
picture_fifo_Delete( p_stream->p_sys->pp_pics );
591589
block_ChainRelease( p_stream->p_sys->p_buffers );
592590
p_stream->p_sys->pp_pics = NULL;
593591
}
594592

593+
vlc_mutex_destroy( &p_stream->p_sys->lock_out );
594+
vlc_cond_destroy( &p_stream->p_sys->cond );
595+
595596
/* Close decoder */
596597
if( id->p_decoder->p_module )
597598
module_unneed( id->p_decoder, id->p_decoder->p_module );

0 commit comments

Comments
 (0)