Commit 3c5f2a8c authored by Denis Charmet's avatar Denis Charmet Committed by Jean-Baptiste Kempf

MKV: Handle file with no duration or 0 duration

Close #6137
Fixes issue in http://forum.videolan.org/viewtopic.php?f=14&t=98525Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 23d75555
......@@ -840,6 +840,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
double f_dur = double(i_duration) * double(i_timescale) / 1000000.0;
i_duration = mtime_t(f_dur);
if( !i_duration ) i_duration = -1;
}
......
......@@ -331,9 +331,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_SUCCESS;
case DEMUX_SET_POSITION:
f = (double)va_arg( args, double );
Seek( p_demux, -1, f, NULL );
return VLC_SUCCESS;
if( p_sys->f_duration > 0.0 )
{
f = (double)va_arg( args, double );
Seek( p_demux, -1, f, NULL );
return VLC_SUCCESS;
}
return VLC_EGENERIC;
case DEMUX_GET_TIME:
pi64 = (int64_t*)va_arg( args, int64_t * );
......
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