Commit 5aa03f37 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: mkv: don't seek on current pos

parent a4ff1de2
...@@ -47,6 +47,7 @@ uint32 vlc_stream_io_callback::read( void *p_buffer, size_t i_size ) ...@@ -47,6 +47,7 @@ uint32 vlc_stream_io_callback::read( void *p_buffer, size_t i_size )
void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode ) void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode )
{ {
int64_t i_pos, i_size; int64_t i_pos, i_size;
int64_t i_current = stream_Tell( s );
switch( mode ) switch( mode )
{ {
...@@ -57,10 +58,13 @@ void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode ) ...@@ -57,10 +58,13 @@ void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode )
i_pos = stream_Size( s ) - i_offset; i_pos = stream_Size( s ) - i_offset;
break; break;
default: default:
i_pos= stream_Tell( s ) + i_offset; i_pos= i_current + i_offset;
break; break;
} }
if(i_pos == i_current)
return;
if( i_pos < 0 || ( ( i_size = stream_Size( s ) ) != 0 && i_pos >= i_size ) ) if( i_pos < 0 || ( ( i_size = stream_Size( s ) ) != 0 && i_pos >= i_size ) )
{ {
mb_eof = true; mb_eof = true;
......
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