Commit 0951cb7c authored by François Cartegnie's avatar François Cartegnie 🤞

vfilter: fps: simplify variable reading and remove fmt copy

parent 6878cf5f
......@@ -140,23 +140,20 @@ static int Open( vlc_object_t *p_this)
if( unlikely( !p_sys ) )
return VLC_ENOMEM;
unsigned frame_rate = p_filter->fmt_out.video.i_frame_rate, frame_rate_base = p_filter->fmt_out.video.i_frame_rate_base;
config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
p_filter->p_cfg );
video_format_Clean( &p_filter->fmt_out.video );
video_format_Copy( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
/* If we don't have fps option, use filter output values */
if( var_InheritURational( p_filter, &frame_rate, &frame_rate_base, CFG_PREFIX "fps" ) )
if( var_InheritURational( p_filter, &p_filter->fmt_out.video.i_frame_rate,
&p_filter->fmt_out.video.i_frame_rate_base, CFG_PREFIX "fps" ) )
{
frame_rate = p_filter->fmt_out.video.i_frame_rate;
frame_rate_base = p_filter->fmt_out.video.i_frame_rate_base;
p_filter->fmt_out.video.i_frame_rate = p_filter->fmt_in.video.i_frame_rate;
p_filter->fmt_out.video.i_frame_rate_base = p_filter->fmt_in.video.i_frame_rate_base;
}
memcpy( &p_filter->fmt_out.video, &p_filter->fmt_in.video, sizeof(video_format_t));
p_filter->fmt_out.video.i_frame_rate = frame_rate;
p_filter->fmt_out.video.i_frame_rate_base = frame_rate_base;
msg_Dbg( p_filter, "Converting fps from %d/%d -> %d/%d",
p_filter->fmt_in.video.i_frame_rate, p_filter->fmt_in.video.i_frame_rate_base,
p_filter->fmt_out.video.i_frame_rate, p_filter->fmt_out.video.i_frame_rate_base );
......
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