[vlc-commits] vfilter: fps: simplify variable reading and remove fmt copy
Francois Cartegnie
git at videolan.org
Wed Nov 30 15:55:08 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 30 14:47:56 2016 +0100| [0951cb7cd2752125d2ec97b450f4ac7061079d07] | committer: Francois Cartegnie
vfilter: fps: simplify variable reading and remove fmt copy
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0951cb7cd2752125d2ec97b450f4ac7061079d07
---
modules/video_filter/fps.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index 2c301e2..36c71c0 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -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 );
More information about the vlc-commits
mailing list