[vlc-commits] demux: mkv: don't seek on current pos
Francois Cartegnie
git at videolan.org
Fri Dec 26 19:29:41 CET 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 25 17:40:39 2014 +0100| [5aa03f3785ecd2e3c871cc22f0ab83d90640b45d] | committer: Francois Cartegnie
demux: mkv: don't seek on current pos
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5aa03f3785ecd2e3c871cc22f0ab83d90640b45d
---
modules/demux/mkv/stream_io_callback.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mkv/stream_io_callback.cpp b/modules/demux/mkv/stream_io_callback.cpp
index 5b539de..7af0871 100644
--- a/modules/demux/mkv/stream_io_callback.cpp
+++ b/modules/demux/mkv/stream_io_callback.cpp
@@ -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 )
{
int64_t i_pos, i_size;
+ int64_t i_current = stream_Tell( s );
switch( 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;
break;
default:
- i_pos= stream_Tell( s ) + i_offset;
+ i_pos= i_current + i_offset;
break;
}
+ if(i_pos == i_current)
+ return;
+
if( i_pos < 0 || ( ( i_size = stream_Size( s ) ) != 0 && i_pos >= i_size ) )
{
mb_eof = true;
More information about the vlc-commits
mailing list