[vlc-devel] [PATCH 1/8] mux: ps: use CLOCK_FREQ for vlc_tick_t based conversions

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 13 14:12:14 CEST 2020


We don't have a helper, yet, to convert ticks to a bitrate.
---
 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 86d33b2e8fc..4e969eb4220 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;
-- 
2.26.2



More information about the vlc-devel mailing list