[vlc-commits] MKV: use the more accurate i_pcr for GET_TIME and GET_POSITION

Steve Lhomme git at videolan.org
Wed Mar 18 11:43:16 CET 2015


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Mar 18 06:26:55 2015 +0000| [2b70dbfde80e88b989cb4ba51a3c0c97ce172a6f] | committer: Jean-Baptiste Kempf

MKV: use the more accurate i_pcr for GET_TIME and GET_POSITION

similar to what avformat does

I forgot to re-submit that one after the other commits went through.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 362cd4f..0bce331 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:



More information about the vlc-commits mailing list