Commit 48a518b8 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: ts: fix incorrect seek times

parent 9f6d6486
......@@ -1524,11 +1524,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
int64_t i_time, i_length;
if( !DVBEventInformation( p_demux, &i_time, &i_length ) &&
i_length > 0 && !SeekToTime( p_demux, p_pmt, TO_SCALE(i_length) * f ) )
i_length > 0 && !SeekToTime( p_demux, p_pmt, (int64_t)(TO_SCALE(i_length) * f) ) )
{
ReadyQueuesPostSeek( p_demux );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
TO_SCALE(i_length) * f );
(int64_t)(TO_SCALE(i_length) * f) );
return VLC_SUCCESS;
}
}
......@@ -1538,16 +1538,19 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_pmt->pcr.i_first > -1 && p_pmt->i_last_dts > VLC_TS_INVALID &&
p_pmt->pcr.i_current > -1 )
{
double i_length = TimeStampWrapAround( p_pmt,
int64_t i_length = TimeStampWrapAround( p_pmt,
p_pmt->i_last_dts ) - p_pmt->pcr.i_first;
if( !SeekToTime( p_demux, p_pmt, p_pmt->pcr.i_first + i_length * f ) )
i64 = p_pmt->pcr.i_first + (int64_t)(i_length * f);
if( i64 <= p_pmt->i_last_dts )
{
if( !SeekToTime( p_demux, p_pmt, i64 ) )
{
ReadyQueuesPostSeek( p_demux );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
FROM_SCALE(p_pmt->pcr.i_first + i_length * f) );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, FROM_SCALE(i64) );
return VLC_SUCCESS;
}
}
}
i64 = stream_Size( p_sys->stream );
if( i64 > 0 &&
......
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