]> git.sesse.net Git - vlc/commitdiff
MKV: use the more accurate i_pcr for GET_TIME and GET_POSITION
authorSteve Lhomme <robUx4@videolabs.io>
Wed, 18 Mar 2015 06:26:55 +0000 (06:26 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 18 Mar 2015 10:42:16 +0000 (11:42 +0100)
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@videolan.org>
modules/demux/mkv/mkv.cpp

index 362cd4f1804916c197e3047a87f4d3ef2013dfda..0bce331b4da65317b248be2de59a4624309f20ca 100644 (file)
@@ -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: