[vlc-commits] demux: h26x: fix frame duration

Zhao Zhili git at videolan.org
Wed Aug 29 15:48:47 CEST 2018


vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Sat Aug  4 00:36:13 2018 +0800| [f3df4c38e174563a8bf1c42bac8a8e68dd32e0c0] | committer: Jean-Baptiste Kempf

demux: h26x: fix frame duration

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 */



More information about the vlc-commits mailing list