[vlc-devel] commit: Fixed skipping data until EOF while using block access. ( Laurent Aimar )

git version control git at videolan.org
Mon Jan 18 21:33:01 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jan 18 21:30:34 2010 +0100| [5bac97318212381119c01909388dcfeff2e4aef0] | committer: Laurent Aimar 

Fixed skipping data until EOF while using block access.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5bac97318212381119c01909388dcfeff2e4aef0
---

 src/input/stream.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/input/stream.c b/src/input/stream.c
index 64bf2db..f1f694c 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -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 );
 




More information about the vlc-devel mailing list