diff aviobuf.c @ 5874:6a24c2ae6ee4 libavformat

Mask away AVSEEK_FORCE properly in some checks in url_fseek() Patch by Tomas H¸«£rdin $(name).$(s/¸«£/a/ $(surname)) AT codemill DOT se
author benoit
date Wed, 24 Mar 2010 10:41:58 +0000
parents a1121e5fa662
children bde9a4b67f86
line wrap: on
line diff
--- a/aviobuf.c	Tue Mar 23 23:58:45 2010 +0000
+++ b/aviobuf.c	Wed Mar 24 10:41:58 2010 +0000
@@ -130,6 +130,8 @@
 {
     int64_t offset1;
     int64_t pos;
+    int force = whence & AVSEEK_FORCE;
+    whence &= ~AVSEEK_FORCE;
 
     if(!s)
         return AVERROR(EINVAL);
@@ -151,8 +153,7 @@
         /* can do the seek inside the buffer */
         s->buf_ptr = s->buffer + offset1;
     } else if(s->is_streamed && !s->write_flag && offset1 >= 0 &&
-              (   offset1 < (s->buf_end - s->buffer) + (1<<16)
-               || (whence & AVSEEK_FORCE))){
+              (offset1 < (s->buf_end - s->buffer) + (1<<16) || force)) {
         while(s->pos < offset && !s->eof_reached)
             fill_buffer(s);
         if (s->eof_reached)