From 9180c588f5e47a2d50a6e6d69ebd0e062a3d584e Mon Sep 17 00:00:00 2001 From: Alaric Senat Date: Mon, 24 Jun 2024 18:11:59 +0200 Subject: [PATCH] transcode: fix picture fifo leak Draining sets the abort flag. It was skipping the picture fifo deletion before. Gbp-Pq: Name 0009-transcode-fix-picture-fifo-leak.patch --- modules/stream_out/transcode/video.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c index e2065af0..c6fe9a57 100644 --- a/modules/stream_out/transcode/video.c +++ b/modules/stream_out/transcode/video.c @@ -658,17 +658,20 @@ static int transcode_video_encoder_open( sout_stream_t *p_stream, void transcode_video_close( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) { - if( p_stream->p_sys->i_threads >= 1 && !p_stream->p_sys->b_abort ) + if( p_stream->p_sys->i_threads >= 1 ) { - vlc_mutex_lock( &p_stream->p_sys->lock_out ); - p_stream->p_sys->b_abort = true; - vlc_cond_signal( &p_stream->p_sys->cond ); - vlc_mutex_unlock( &p_stream->p_sys->lock_out ); + if (!p_stream->p_sys->b_abort) + { + vlc_mutex_lock( &p_stream->p_sys->lock_out ); + p_stream->p_sys->b_abort = true; + vlc_cond_signal( &p_stream->p_sys->cond ); + vlc_mutex_unlock( &p_stream->p_sys->lock_out ); - vlc_join( p_stream->p_sys->thread, NULL ); + vlc_join( p_stream->p_sys->thread, NULL ); + block_ChainRelease( p_stream->p_sys->p_buffers ); + } picture_fifo_Delete( p_stream->p_sys->pp_pics ); - block_ChainRelease( p_stream->p_sys->p_buffers ); } if( p_stream->p_sys->i_threads >= 1 ) -- 2.30.2