[vlc-commits] demux: use vlc_tick_from_samples instead of hardcoded values
Steve Lhomme
git at videolan.org
Mon Aug 17 16:14:35 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Aug 13 06:52:08 2020 +0200| [b475ae88dbd396d24d2d9aee2f1ff393c9afa8e4] | committer: Steve Lhomme
demux: use vlc_tick_from_samples instead of hardcoded values
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b475ae88dbd396d24d2d9aee2f1ff393c9afa8e4
---
src/input/demux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/input/demux.c b/src/input/demux.c
index db1b46532e..55ffbb5165 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -316,7 +316,7 @@ int demux_vaControlHelper( stream_t *s,
case DEMUX_GET_LENGTH:
if( i_bitrate > 0 && i_end > i_start )
{
- *va_arg( args, vlc_tick_t * ) = INT64_C(8000000) * (i_end - i_start) / i_bitrate;
+ *va_arg( args, vlc_tick_t * ) = vlc_tick_from_samples((i_end - i_start) * 8, i_bitrate);
return VLC_SUCCESS;
}
return VLC_EGENERIC;
@@ -324,7 +324,7 @@ int demux_vaControlHelper( stream_t *s,
case DEMUX_GET_TIME:
if( i_bitrate > 0 && i_tell >= i_start )
{
- *va_arg( args, vlc_tick_t * ) = INT64_C(8000000) * (i_tell - i_start) / i_bitrate;
+ *va_arg( args, vlc_tick_t * ) = vlc_tick_from_samples((i_tell - i_start) * 8, i_bitrate);
return VLC_SUCCESS;
}
return VLC_EGENERIC;
More information about the vlc-commits
mailing list