[vlc-devel] [PATCH 5/8] demux: use samples_from_vlc_tick to convert ticks to blocks

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


---
 src/input/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/demux.c b/src/input/demux.c
index 55ffbb51655..5024c9576e2 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -359,7 +359,7 @@ int demux_vaControlHelper( stream_t *s,
             i64 = va_arg( args, vlc_tick_t );
             if( i_bitrate > 0 && i64 >= 0 )
             {
-                int64_t i_block = i64 * i_bitrate / INT64_C(8000000) / i_align;
+                int64_t i_block = samples_from_vlc_tick( i64, i_bitrate ) / (8 * i_align);
                 if( vlc_stream_Seek( s, i_start + i_block * i_align ) )
                 {
                     return VLC_EGENERIC;
-- 
2.26.2



More information about the vlc-devel mailing list