Commit f02d5f70 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* ps.c: Base SET_TIME on the current byteposition. This helps seeking in VBR...

* ps.c: Base SET_TIME on the current byteposition. This helps seeking in VBR files. Seeking forward will no longer seek backward instead.
parent ebcd5487
...@@ -482,6 +482,19 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -482,6 +482,19 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC; return VLC_EGENERIC;
case DEMUX_SET_TIME: case DEMUX_SET_TIME:
i64 = (int64_t)va_arg( args, int64_t );
if( p_sys->i_time_track >= 0 && p_sys->i_current_pts > 0 )
{
int64_t i_now = p_sys->i_current_pts - p_sys->tk[p_sys->i_time_track].i_first_pts;
int64_t i_pos = stream_Tell( p_demux->s );
int64_t i_offset = i_pos / (i_now / 1000000) * ((i64 - i_now) / 1000000);
stream_Seek( p_demux->s, i_pos + i_offset);
es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
return VLC_SUCCESS;
}
return VLC_EGENERIC;
case DEMUX_GET_FPS: case DEMUX_GET_FPS:
default: default:
return VLC_EGENERIC; return VLC_EGENERIC;
......
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