[vlc-commits] mux: ps: use CLOCK_FREQ for vlc_tick_t based conversions

Steve Lhomme git at videolan.org
Mon Aug 17 16:14:31 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Aug 13 06:40:51 2020 +0200| [5bfcd57fb5688f2b1786c267025434964b15e12e] | committer: Steve Lhomme

mux: ps: use CLOCK_FREQ for vlc_tick_t based conversions

We don't have a helper, yet, to convert ticks to a bitrate.

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

 modules/mux/mpeg/ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/mux/mpeg/ps.c b/modules/mux/mpeg/ps.c
index 86d33b2e8f..4e969eb422 100644
--- a/modules/mux/mpeg/ps.c
+++ b/modules/mux/mpeg/ps.c
@@ -490,7 +490,7 @@ static int Mux( sout_mux_t *p_mux )
                 if( p_sys->i_instant_size &&
                     i_dts - p_sys->i_instant_dts > VLC_TICK_FROM_SEC(1))
                 {
-                    int64_t i_instant_bitrate = p_sys->i_instant_size * 8000000 /
+                    int64_t i_instant_bitrate = p_sys->i_instant_size * 8 * CLOCK_FREQ /
                             ( i_dts - p_sys->i_instant_dts );
 
                     p_sys->i_instant_bitrate += i_instant_bitrate;



More information about the vlc-commits mailing list