[vlc-devel] [PATCH] demux: h26x: fix frame duration

Zhao Zhili quinkblack at foxmail.com
Fri Aug 3 18:36:13 CEST 2018


---
See https://mailman.videolan.org/pipermail/vlc-devel/2018-March/118214.html

 modules/demux/mpeg/h26x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mpeg/h26x.c b/modules/demux/mpeg/h26x.c
index 155e93d269..bc1022bc59 100644
--- a/modules/demux/mpeg/h26x.c
+++ b/modules/demux/mpeg/h26x.c
@@ -481,8 +481,8 @@ static int Demux( demux_t *p_demux)
                 unsigned i_nb_fields;
                 if( i_frame_length > 0 )
                 {
-                    i_nb_fields = i_frame_length * 2 * p_sys->frame_rate_num /
-                                  ( p_sys->frame_rate_den * CLOCK_FREQ );
+                    i_nb_fields = round( (double)i_frame_length * 2 * p_sys->frame_rate_num /
+                                  ( p_sys->frame_rate_den * CLOCK_FREQ ) );
                 }
                 else i_nb_fields = 2;
                 if( i_nb_fields <= 6 ) /* in the legit range */
-- 
2.15.1 (Apple Git-101)





More information about the vlc-devel mailing list