[vlc-devel] [PATCH 13/26] sout:encoder: factorize the output i_codec fix
Steve Lhomme
robux4 at ycbcr.xyz
Mon Jan 18 08:32:52 UTC 2021
In case the i_codec is set not set to a codec format.
---
modules/stream_out/transcode/encoder/audio.c | 8 +-------
modules/stream_out/transcode/encoder/video.c | 3 ---
src/stream_output/stream_output.c | 2 ++
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/modules/stream_out/transcode/encoder/audio.c b/modules/stream_out/transcode/encoder/audio.c
index 704f83a0278..1158095b3b5 100644
--- a/modules/stream_out/transcode/encoder/audio.c
+++ b/modules/stream_out/transcode/encoder/audio.c
@@ -62,13 +62,7 @@ int transcode_encoder_audio_open( transcode_encoder_t *p_enc,
p_enc->p_encoder->p_cfg = p_cfg->p_config_chain;
p_enc->p_encoder->fmt_out.i_codec = p_cfg->i_codec;
- if( sout_EncoderOpen(p_enc->p_encoder, p_cfg->psz_name, true) == VLC_SUCCESS )
- {
- p_enc->p_encoder->fmt_out.i_codec =
- vlc_fourcc_GetCodec( AUDIO_ES, p_enc->p_encoder->fmt_out.i_codec );
- }
-
- return ( p_enc->p_encoder->p_module ) ? VLC_SUCCESS: VLC_EGENERIC;
+ return sout_EncoderOpen(p_enc->p_encoder, p_cfg->psz_name, true);
}
static int encoder_audio_configure( const transcode_encoder_config_t *p_cfg,
diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c
index 1fc3c1ed341..e396ff5d9b7 100644
--- a/modules/stream_out/transcode/encoder/video.c
+++ b/modules/stream_out/transcode/encoder/video.c
@@ -457,9 +457,6 @@ int transcode_encoder_video_open( transcode_encoder_t *p_enc,
return VLC_EGENERIC;
/* */
- p_enc->p_encoder->fmt_out.i_codec =
- vlc_fourcc_GetCodec( VIDEO_ES, p_enc->p_encoder->fmt_out.i_codec );
-
vlc_sem_init( &p_enc->picture_pool_has_room, p_cfg->video.threads.pool_size );
vlc_cond_init( &p_enc->cond );
p_enc->p_buffers = NULL;
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 8441b08a95a..18ec15da1ec 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -1079,5 +1079,7 @@ int sout_EncoderOpen(encoder_t *p_encoder, const char *name, bool strict)
p_encoder );
if (!p_encoder->p_module)
return VLC_ENOMOD;
+ p_encoder->fmt_out.i_codec =
+ vlc_fourcc_GetCodec( p_encoder->fmt_in.i_cat, p_encoder->fmt_out.i_codec );
return VLC_SUCCESS;
}
--
2.29.2
More information about the vlc-devel
mailing list