[vlc-commits] filter: fps: use frame_rate from fmt_out if no "fps" option

Thomas Guillem git at videolan.org
Thu Jan 18 17:37:27 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jan 17 11:48:30 2018 +0100| [16bae987fbe129e421ce030ebc48570ea334c186] | committer: Thomas Guillem

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=16bae987fbe129e421ce030ebc48570ea334c186
---

 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