[vlc-devel] [PATCH] transcode: clean the decoders using decoder_Destroy()
Steve Lhomme
robux4 at ycbcr.xyz
Wed Feb 20 16:30:48 CET 2019
They are already using decoder_Init().
As a bonus the ES formats are cleaned afterwards.
---
modules/stream_out/transcode/audio.c | 8 +-------
modules/stream_out/transcode/spu.c | 5 +----
modules/stream_out/transcode/video.c | 5 +----
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 82578c9077..296fc10b85 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -202,13 +202,7 @@ int transcode_audio_init( sout_stream_t *p_stream, const es_format_t *p_fmt,
void transcode_audio_clean( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
{
/* Close decoder */
- if( id->p_decoder->p_module )
- module_unneed( id->p_decoder, id->p_decoder->p_module );
- id->p_decoder->p_module = NULL;
-
- if( id->p_decoder->p_description )
- vlc_meta_Delete( id->p_decoder->p_description );
- id->p_decoder->p_description = NULL;
+ decoder_Destroy( id->p_decoder );
/* Close encoder */
transcode_encoder_close( id->encoder );
diff --git a/modules/stream_out/transcode/spu.c b/modules/stream_out/transcode/spu.c
index b491774241..8a9efa2227 100644
--- a/modules/stream_out/transcode/spu.c
+++ b/modules/stream_out/transcode/spu.c
@@ -160,10 +160,7 @@ void transcode_spu_clean( sout_stream_t *p_stream, sout_stream_id_sys_t *id)
{
VLC_UNUSED(p_stream);
/* Close decoder */
- if( id->p_decoder->p_module )
- module_unneed( id->p_decoder, id->p_decoder->p_module );
- if( id->p_decoder->p_description )
- vlc_meta_Delete( id->p_decoder->p_description );
+ decoder_Destroy( id->p_decoder );
/* Close encoder */
if( id->encoder )
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 1a81722027..b6d74daef4 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -311,10 +311,7 @@ void transcode_video_clean( sout_stream_t *p_stream,
VLC_UNUSED(p_stream);
/* Close decoder */
- if( id->p_decoder->p_module )
- module_unneed( id->p_decoder, id->p_decoder->p_module );
- if( id->p_decoder->p_description )
- vlc_meta_Delete( id->p_decoder->p_description );
+ decoder_Destroy( id->p_decoder );
/* Close encoder */
transcode_encoder_close( id->encoder );
--
2.17.1
More information about the vlc-devel
mailing list