[vlc-commits] filter: fps: use frame_rate from fmt_out if no "fps" option
Thomas Guillem
git at videolan.org
Fri Jan 19 12:01:29 CET 2018
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jan 17 11:48:30 2018 +0100| [7b1eb137a47b571da4561cbef64c7d881386b48b] | committer: Jean-Baptiste Kempf
filter: fps: use frame_rate from fmt_out if no "fps" option
This fixes invalid n to n fps conversion when this filter is setup from
transcode/video.
(cherry picked from commit 16bae987fbe129e421ce030ebc48570ea334c186)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=7b1eb137a47b571da4561cbef64c7d881386b48b
---
modules/video_filter/fps.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index c4bc35e1e6..d8a6c14a89 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -146,6 +146,9 @@ static int Open( vlc_object_t *p_this)
config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
p_filter->p_cfg );
+ const unsigned int i_out_frame_rate = p_filter->fmt_out.video.i_frame_rate;
+ const unsigned int i_out_frame_rate_base = p_filter->fmt_out.video.i_frame_rate_base;
+
video_format_Clean( &p_filter->fmt_out.video );
video_format_Copy( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
@@ -153,8 +156,8 @@ static int Open( vlc_object_t *p_this)
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" ) )
{
- 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;
+ p_filter->fmt_out.video.i_frame_rate = i_out_frame_rate;
+ p_filter->fmt_out.video.i_frame_rate_base = i_out_frame_rate_base;
}
msg_Dbg( p_filter, "Converting fps from %d/%d -> %d/%d",
More information about the vlc-commits
mailing list