Commit 55d25614 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

* demux: stream_DemuxControl: emulate seek.

parent 25fc0180
...@@ -456,7 +456,24 @@ static int DStreamControl( stream_t *s, int i_query, va_list args ) ...@@ -456,7 +456,24 @@ static int DStreamControl( stream_t *s, int i_query, va_list args )
return VLC_SUCCESS; return VLC_SUCCESS;
case STREAM_SET_POSITION: case STREAM_SET_POSITION:
return VLC_EGENERIC; {
int64_t i64 = (int64_t)va_arg( args, int64_t );
int i_skip;
if( i64 < p_sys->i_pos )
return VLC_EGENERIC;
i_skip = i64 - p_sys->i_pos;
while( i_skip > 0 )
{
int i_read = DStreamRead( s, NULL, i_skip );
if( i_read <= 0 )
return VLC_EGENERIC;
i_skip -= i_read;
}
return VLC_SUCCESS;
}
case STREAM_GET_MTU: case STREAM_GET_MTU:
p_int = (int*) va_arg( args, int * ); p_int = (int*) va_arg( args, int * );
......
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