vlc | branch: master | Steve Lhomme <[email protected]> | Thu Jan 14 13:46:14 2021 +0100| [3ff21a414bd4dc42ecbc5adae6b137d88e8f730a] | committer: Steve Lhomme
transcode: use the transcoder config to setup the test input format Don't use previously set values on the output format which have no good significance. The format requested by the user is the combination of source format + user configuration. Set better encoder fmt_out values that the user configuration (which may be 0). > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ff21a414bd4dc42ecbc5adae6b137d88e8f730a --- modules/stream_out/transcode/encoder/video.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c index d2513c68c4..2ba109a1af 100644 --- a/modules/stream_out/transcode/encoder/video.c +++ b/modules/stream_out/transcode/encoder/video.c @@ -301,23 +301,19 @@ int transcode_encoder_video_test( encoder_t *p_encoder, video_format_t *p_vfmt_out = &p_encoder->fmt_out.video; /* Requested output */ - p_vfmt_out->i_width = p_cfg->video.i_width & ~1; - p_vfmt_out->i_height = p_cfg->video.i_height & ~1; p_encoder->fmt_out.i_bitrate = p_cfg->video.i_bitrate; /* The dimensions will be set properly later on. * Just put sensible values so we can test an encoder is available. */ /* Input */ p_vfmt_in->i_chroma = i_codec_in; - p_vfmt_in->i_width = FIRSTVALID( p_vfmt_out->i_width, p_dec_in->i_width, 16 ) & ~1; - p_vfmt_in->i_height = FIRSTVALID( p_vfmt_out->i_height, p_dec_in->i_height, 16 ) & ~1; - p_vfmt_in->i_visible_width = FIRSTVALID( p_vfmt_out->i_visible_width, - p_dec_in->i_visible_width, p_vfmt_in->i_width ) & ~1; - p_vfmt_in->i_visible_height = FIRSTVALID( p_vfmt_out->i_visible_height, - p_dec_in->i_visible_height, p_vfmt_in->i_height ) & ~1; + transcode_video_size_config_apply(VLC_OBJECT(p_encoder), p_dec_in, p_cfg, p_vfmt_in); p_vfmt_in->i_frame_rate = ENC_FRAMERATE; p_vfmt_in->i_frame_rate_base = ENC_FRAMERATE_BASE; + p_vfmt_out->i_width = p_vfmt_in->i_width & ~1; + p_vfmt_out->i_height = p_vfmt_in->i_height & ~1; + module_t *p_module = module_need( p_encoder, "encoder", p_cfg->psz_name, true ); if( !p_module ) { _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
