Commit 798ee99d authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

demux: mkv: don't seek on current pos

(cherry picked from commit 5aa03f3785ecd2e3c871cc22f0ab83d90640b45d)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>

Ref #14044
parent 4b1b487f
...@@ -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