Commit 2ec4cd4a authored by Steve Lhomme's avatar Steve Lhomme
Browse files

transcode: use transcode_video_size_config_apply to get the encoder input format

Use it via transcode_encoder_video_set_src() which does a bit more.

As opposed to before we set the output dimensions as the ones from the input,
not the other way around.
parent 9de28aa2
......@@ -238,16 +238,14 @@ void transcode_encoder_video_configure( vlc_object_t *p_obj,
p_enc->p_encoder->fmt_out.i_codec = p_enc_out->i_chroma = p_cfg->i_codec;
p_enc->p_encoder->fmt_out.i_bitrate = p_cfg->video.i_bitrate;
p_enc_out->i_sar_num = p_enc_out->i_sar_den = 0;
if( p_cfg->video.fps.num )
transcode_encoder_video_set_src(p_enc->p_encoder, p_src, p_cfg);
if (p_enc_in->i_frame_rate && p_enc_in->i_frame_rate_base)
{
p_enc_in->i_frame_rate = p_enc_out->i_frame_rate =
p_cfg->video.fps.num;
p_enc_in->i_frame_rate_base = p_enc_out->i_frame_rate_base =
__MAX(p_cfg->video.fps.den, 1);
p_enc_out->i_frame_rate = p_enc_in->i_frame_rate;
p_enc_out->i_frame_rate_base = p_enc_in->i_frame_rate_base;
}
/* Complete source format */
p_enc_in->orientation = ORIENT_NORMAL;
p_enc_out->orientation = p_enc_in->orientation;
p_enc_in->i_chroma = p_enc->p_encoder->fmt_in.i_codec;
......@@ -259,13 +257,11 @@ void transcode_encoder_video_configure( vlc_object_t *p_obj,
p_dec_out->i_frame_rate, p_dec_out->i_frame_rate_base,
p_enc_in->i_frame_rate, p_enc_in->i_frame_rate_base );
/* Modify to requested sizes/scale */
transcode_video_size_config_apply( p_obj, p_src, p_cfg, p_enc_out );
/* Propagate sizing to output */
p_enc_in->i_width = p_enc_out->i_width;
p_enc_in->i_visible_width = p_enc_out->i_visible_width;
p_enc_in->i_height = p_enc_out->i_height;
p_enc_in->i_visible_height = p_enc_out->i_visible_height;
p_enc_out->i_width = p_enc_in->i_width;
p_enc_out->i_visible_width = p_enc_in->i_visible_width;
p_enc_out->i_height = p_enc_in->i_height;
p_enc_out->i_visible_height = p_enc_out->i_visible_height;
transcode_video_sar_apply( p_src, p_enc_out );
p_enc_in->i_sar_num = p_enc_out->i_sar_num;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment