]> git.sesse.net Git - vlc/commitdiff
Fixed skipping data until EOF while using block access.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 18 Jan 2010 20:30:34 +0000 (21:30 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 18 Jan 2010 20:31:50 +0000 (21:31 +0100)
src/input/stream.c

index 64bf2db82f80e2eb5bba7fbcb1002ca96938eb59..f1f694c6cb92974fadd3aac3f935c55a92692c3e 100644 (file)
@@ -960,17 +960,18 @@ static int AStreamSeekBlock( stream_t *s, int64_t i_pos )
     {
         do
         {
-            /* Read and skip enough data */
-            if( AStreamRefillBlock( s ) )
-                return VLC_EGENERIC;
-
             while( p_sys->block.p_current &&
-                   p_sys->i_pos + p_sys->block.p_current->i_buffer - p_sys->block.i_offset < i_pos )
+                   p_sys->i_pos + p_sys->block.p_current->i_buffer - p_sys->block.i_offset <= i_pos )
             {
                 p_sys->i_pos += p_sys->block.p_current->i_buffer - p_sys->block.i_offset;
                 p_sys->block.p_current = p_sys->block.p_current->p_next;
                 p_sys->block.i_offset = 0;
             }
+            if( !p_sys->block.p_current && AStreamRefillBlock( s ) )
+            {
+                if( p_sys->i_pos != i_pos )
+                    return VLC_EGENERIC;
+            }
         }
         while( p_sys->block.i_start + p_sys->block.i_size < i_pos );