From: Alaric Senat Date: Mon, 24 Jun 2024 16:11:59 +0000 (+0200) Subject: transcode: fix picture fifo leak X-Git-Tag: archive/raspbian/3.0.21-6+rpi1^2~116 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=22e22b69df7a4a2163b0e8885f6be4af181ba648;p=vlc.git 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 --- 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 )