[vlc-commits] demux: es: use vlc_tick_from_samples instead of hardcoded values

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Aug 13 06:48:38 2020 +0200| [29a98ecf7c84c30a7e66932fbd2caeb8b1e3298c] | committer: Steve Lhomme

demux: es: use vlc_tick_from_samples instead of hardcoded values

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

 modules/demux/mpeg/es.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index ac5924f314..73449bf2a2 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -585,9 +585,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     {
         if( p_sys->i_bitrate_avg > 0 )
         {
-            int64_t i_time = INT64_C(8000000)
-                * ( vlc_stream_Tell(p_demux->s) - p_sys->i_stream_offset )
-                / p_sys->i_bitrate_avg;
+            vlc_tick_t i_time = vlc_tick_from_samples(
+                ( vlc_stream_Tell(p_demux->s) - p_sys->i_stream_offset ) * 8
+                , p_sys->i_bitrate_avg );
 
             /* Fix time_offset */
             if( i_time >= 0 )



More information about the vlc-commits mailing list