[vlc-devel] [PATCH 02/11] mkv: fixed DEMUX_GET_POSITION

Filip Roséen filip at videolabs.io
Sat May 21 02:17:54 CEST 2016


Since p_sys->i_pts is updated for every block sent, this should be the
base for DEMUX_GET_POSITION.
---
 modules/demux/mkv/mkv.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 230597e..65c5fd5 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -351,7 +351,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_GET_POSITION:
             pf = va_arg( args, double * );
             if ( p_sys->f_duration > 0.0 )
-                *pf = static_cast<double> (p_sys->i_pcr >= p_sys->i_start_pts ? p_sys->i_pcr : p_sys->i_start_pts ) / (1000.0 * p_sys->f_duration);
+                *pf = static_cast<double> ( p_sys->i_pts / ( 1000.0 * p_sys->f_duration ) );
             return VLC_SUCCESS;
 
         case DEMUX_SET_POSITION:
-- 
2.8.2



More information about the vlc-devel mailing list