[vlc-devel] [PATCH 1/2] demux:mkv: unmark the EOF if the seek failed and we're still in usable data

Steve Lhomme robux4 at videolabs.io
Fri Feb 2 17:02:05 CET 2018


---
 modules/demux/mkv/stream_io_callback.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/demux/mkv/stream_io_callback.cpp b/modules/demux/mkv/stream_io_callback.cpp
index 570229e262..6a50745f13 100644
--- a/modules/demux/mkv/stream_io_callback.cpp
+++ b/modules/demux/mkv/stream_io_callback.cpp
@@ -64,7 +64,16 @@ void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode )
     }
 
     if(i_pos == i_current)
+    {
+        if (mb_eof)
+        {
+            // if previous setFilePointer() failed we may be back in the available data
+            i_size = stream_Size( s );
+            if ( i_size != 0 && i_pos < i_size )
+                mb_eof = vlc_stream_Seek( s, i_pos ) != VLC_SUCCESS;
+        }
         return;
+    }
 
     if( i_pos < 0 || ( ( i_size = stream_Size( s ) ) != 0 && i_pos >= i_size ) )
     {
-- 
2.14.2



More information about the vlc-devel mailing list