[vlc-devel] [PATCH 12/26] sout:encoder: factorize the encoder input chroma fix
Steve Lhomme
robux4 at ycbcr.xyz
Mon Jan 18 08:32:51 UTC 2021
Encoders set the input "codec" they accept which is a chroma format, but they
don't set the value in i_chroma as well.
---
modules/stream_out/transcode/encoder/video.c | 5 -----
src/misc/image.c | 1 -
src/stream_output/stream_output.c | 2 ++
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c
index ae5982cfcc2..1fc3c1ed341 100644
--- a/modules/stream_out/transcode/encoder/video.c
+++ b/modules/stream_out/transcode/encoder/video.c
@@ -341,9 +341,6 @@ int transcode_encoder_video_test( encoder_t *p_encoder,
p_encoder->p_module = NULL;
}
- if( likely(!p_encoder->fmt_in.video.i_chroma) ) /* always missing, and required by filter chain */
- p_encoder->fmt_in.video.i_chroma = p_encoder->fmt_in.i_codec;
-
/* output our requested format */
es_format_Copy( p_enc_wanted_in, &p_encoder->fmt_in );
video_format_FixRgb( &p_enc_wanted_in->video ); /* set masks when RGB */
@@ -459,8 +456,6 @@ int transcode_encoder_video_open( transcode_encoder_t *p_enc,
if( sout_EncoderOpen(p_enc->p_encoder, p_cfg->psz_name, true) != VLC_SUCCESS )
return VLC_EGENERIC;
- p_enc->p_encoder->fmt_in.video.i_chroma = p_enc->p_encoder->fmt_in.i_codec;
-
/* */
p_enc->p_encoder->fmt_out.i_codec =
vlc_fourcc_GetCodec( VIDEO_ES, p_enc->p_encoder->fmt_out.i_codec );
diff --git a/src/misc/image.c b/src/misc/image.c
index b1fd95aaa8c..04420c402b2 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -751,7 +751,6 @@ static encoder_t *CreateEncoder( vlc_object_t *p_this, const video_format_t *fmt
DeleteEncoder( p_enc );
return NULL;
}
- p_enc->fmt_in.video.i_chroma = p_enc->fmt_in.i_codec;
return p_enc;
}
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 58a006433e8..8441b08a95a 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -1025,6 +1025,8 @@ static int encoder_start_video(void *func, bool forced, va_list ap)
else
{
assert(p_enc->pf_encode_video != NULL);
+ if( likely(!p_enc->fmt_in.video.i_chroma) )
+ p_enc->fmt_in.video.i_chroma = p_enc->fmt_in.i_codec;
}
return ret;
}
--
2.29.2
More information about the vlc-devel
mailing list