[vlc-devel] commit: Fix prebuffering after seek. ( Tobias Güntner )

git version control git at videolan.org
Sun Jan 10 14:41:51 CET 2010


vlc | branch: master | Tobias Güntner <fatbull at web.de> | Wed Nov 25 16:05:57 2009 +0100| [722b9d0efed6161666b7a8993809e0c760be221b] | committer: Laurent Aimar 

Fix prebuffering after seek.

Signed-off-by: Laurent Aimar <fenrir at videolan.org>

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

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

diff --git a/src/input/stream.c b/src/input/stream.c
index 00ecbae..64bf2db 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -1428,13 +1428,14 @@ static void AStreamPrebufferStream( stream_t *s )
 
         int64_t i_date = mdate();
         int i_read;
+        int i_buffered = tk->i_end - tk->i_start;
 
-        if( s->b_die || tk->i_end >= STREAM_CACHE_PREBUFFER_SIZE )
+        if( s->b_die || i_buffered >= STREAM_CACHE_PREBUFFER_SIZE )
         {
             int64_t i_byterate;
 
             /* Update stat */
-            p_sys->stat.i_bytes = tk->i_end - tk->i_start;
+            p_sys->stat.i_bytes = i_buffered;
             p_sys->stat.i_read_time = i_date - i_start;
             i_byterate = ( INT64_C(1000000) * p_sys->stat.i_bytes ) /
                          (p_sys->stat.i_read_time+1);
@@ -1448,9 +1449,9 @@ static void AStreamPrebufferStream( stream_t *s )
         }
 
         /* */
-        i_read = STREAM_CACHE_TRACK_SIZE - tk->i_end;
+        i_read = STREAM_CACHE_TRACK_SIZE - i_buffered;
         i_read = __MIN( p_sys->stream.i_read_size, i_read );
-        i_read = AReadStream( s, &tk->p_buffer[tk->i_end], i_read );
+        i_read = AReadStream( s, &tk->p_buffer[i_buffered], i_read );
         if( i_read <  0 )
             continue;
         else if( i_read == 0 )




More information about the vlc-devel mailing list