[vlc-devel] [PATCH] MKV: use the more accurate i_pcr for GET_TIME and GET_POSITION
Steve Lhomme
robUx4 at videolabs.io
Thu Mar 12 15:42:03 CET 2015
similar to what avformat does
---
modules/demux/mkv/mkv.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index b32c594..214d010 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -332,7 +332,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_POSITION:
pf = (double*)va_arg( args, double * );
if ( p_sys->f_duration > 0.0 )
- *pf = (double)(p_sys->i_pts >= p_sys->i_start_pts ? p_sys->i_pts : p_sys->i_start_pts ) / (1000.0 * p_sys->f_duration);
+ *pf = (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);
return VLC_SUCCESS;
case DEMUX_SET_POSITION:
@@ -346,7 +346,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME:
pi64 = (int64_t*)va_arg( args, int64_t * );
- *pi64 = p_sys->i_pts;
+ *pi64 = p_sys->i_pcr;
return VLC_SUCCESS;
case DEMUX_GET_TITLE_INFO:
--
2.3.2
More information about the vlc-devel
mailing list