Commit 2b70dbfd authored by Steve Lhomme's avatar Steve Lhomme Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3ca68a65
...@@ -332,7 +332,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -332,7 +332,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_POSITION: case DEMUX_GET_POSITION:
pf = (double*)va_arg( args, double * ); pf = (double*)va_arg( args, double * );
if ( p_sys->f_duration > 0.0 ) 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; return VLC_SUCCESS;
case DEMUX_SET_POSITION: case DEMUX_SET_POSITION:
...@@ -346,7 +346,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -346,7 +346,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TIME: case DEMUX_GET_TIME:
pi64 = (int64_t*)va_arg( args, int64_t * ); pi64 = (int64_t*)va_arg( args, int64_t * );
*pi64 = p_sys->i_pts; *pi64 = p_sys->i_pcr;
return VLC_SUCCESS; return VLC_SUCCESS;
case DEMUX_GET_TITLE_INFO: case DEMUX_GET_TITLE_INFO:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment